Increase PROTO_PRE_ALLOC_HF_FIELDS_MEM.
[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], [9])
10 m4_define([version_micro], [0])
11 dnl Updated by make-version.pl
12 m4_define([version_extra], [])
13 m4_define([version_micro_extra], m4_join([], version_micro, version_extra))
14
15 AC_INIT(Wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
16 CONFIG_ARGS="$*"
17 AC_SUBST(CONFIG_ARGS)
18
19 VERSION_RELEASE="version_major.version_minor"
20 AC_SUBST(VERSION_RELEASE)
21 AC_DEFINE_UNQUOTED([VERSION_RELEASE], ["$VERSION_RELEASE"], [Wireshark feature release version (X.Y)])
22
23 # Minimum autoconf version we require.
24 AC_PREREQ(2.64)
25 # Variable expansion doesn't work in AC_PREREQ()
26 AC_MIN_VERSION=2.64
27 AC_SUBST(AC_MIN_VERSION)
28
29 dnl Make sure to keep ACLOCAL_AMFLAGS in Makefile.am and AC_CONFIG_MACRO_DIRS
30 dnl in configure.ac in sync, otherwise there will be an error running autogen.sh.
31 m4_ifdef([AC_CONFIG_MACRO_DIRS],[AC_CONFIG_MACRO_DIRS([m4])])
32
33 dnl Check for CPU / vendor / OS
34 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
35 dnl `AC_CANONICAL_HOST', or `AC_CANONICAL_TARGET', depending on the
36 dnl needs.  Using `AC_CANONICAL_TARGET' is enough to run the two other
37 dnl macros.
38 dnl
39 dnl As nothing in the Wireshark is itself a build tool (we are not,
40 dnl for example, a compiler that generates machine code), we probably
41 dnl don't need AC_CANONICAL_TARGET, so, in theory, we should be able
42 dnl to use AC_CANONICAL_BUILD and AC_CANONICAL_HOST - or perhaps just
43 dnl AC_CANONICAL_HOST - instead.  Note that we do have tools, such as
44 dnl lemon, that need to be built for the build machine, not for the
45 dnl host machine, so we might need both.
46 dnl
47 dnl This has to be done *after* AC_INIT, otherwise autogen.sh fails.
48
49 dnl AC_CANONICAL_BUILD
50 dnl AC_CANONICAL_HOST
51 AC_CANONICAL_TARGET
52
53 AM_INIT_AUTOMAKE([1.11 tar-ustar dist-xz no-dist-gzip subdir-objects foreign])
54
55 # Enable silent builds by default. Verbose builds can be enabled with "./configure
56 # --enable-silent-rules ..." or "make V=1 ..."
57 AM_SILENT_RULES([yes])
58
59 # Make Wireshark's version available in config.h
60 AC_DEFINE(VERSION_MAJOR, version_major, [Wireshark's major version])
61 AC_DEFINE(VERSION_MINOR, version_minor, [Wireshark's minor version])
62 AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])
63
64 AC_DEFINE_UNQUOTED(VERSION_FLAVOR,
65         ["${WIRESHARK_VERSION_FLAVOR:-"Development Build"}"], [Wireshark's package flavor])
66
67 LT_PREREQ([2.2.2])
68 LT_INIT([disable-static])
69 AC_SUBST([LIBTOOL_DEPS])
70
71 AC_CONFIG_LIBOBJ_DIR([wsutil])
72
73 #
74 # Checks for programs used in the main build process.
75 #
76 # See doc/README.developer for allowed C99 features
77 #
78 AC_PROG_CC_C99
79 if test "$ac_cv_prog_cc_c99" = "no"
80 then
81         AC_MSG_ERROR([The C compiler does not support C99])
82 fi
83 AC_PROG_CPP
84
85 AC_PROG_CXX
86 if test ! -z "$CXX"; then
87         #
88         # OK, we found something AC_LANG_CXX thinks is a C++ compiler,
89         # but is it one?
90         #
91         # Some UN*Xes have, by default, a case-insensitive file
92         # system, and AC_PROG_CXX looks for, among other things,
93         # "CC" as a C++ compiler, and, if you have a case-insensitive
94         # file system and a C compiler named "cc" (both true, by
95         # default, on macOS), AC_PROG_CXX may end up thinking it's
96         # the C++ compiler.
97         #
98         # So we check by feeding the purported C++ compiler a
99         # program using C++ features (iostream).
100         #
101         AC_MSG_CHECKING(whether $CXX is a C++ compiler)
102         AC_LANG_PUSH([C++])
103         AC_LINK_IFELSE([AC_LANG_PROGRAM(
104         [
105 #include <iostream>
106         ],
107         [
108         std::cout << "Hello World! ";
109         return 0;
110         ])],
111                 [AC_MSG_RESULT(yes)],
112                 [
113                         AC_MSG_RESULT(no)
114                         CXX=""
115                 ])
116         AC_LANG_POP([C++])
117 fi
118
119 # Qt 5.7 or later requires C++11
120 AS_IF([test -n "$CXX"],
121         [AX_CXX_COMPILE_STDCXX([11], [noext], [optional])])
122
123 # Set CC_FOR_BUILD (the *local* gcc to use for building e.g. lemon)
124 if test "x$cross_compiling" = xno -a -z "$CC_FOR_BUILD"; then
125         CC_FOR_BUILD="$CC"
126 fi
127 AX_PROG_CC_FOR_BUILD
128
129 #
130 # Check for versions of "sed" inadequate to handle, in libtool, a list
131 # of object files as large as the list in Wireshark.
132 #
133 AC_PROG_SED
134
135 AC_PROG_LN_S
136 AC_PROG_MKDIR_P
137
138 AC_PATH_PROG(PERL, perl)
139
140 # Check for Python.
141 AC_PATH_PROGS(PYTHON, python python3)
142 if test ! -z "$PYTHON"; then
143         #
144         # OK, we found Python; is it Python 2.5 or later?
145         # Note: we don't use named components for sys.version_info to get
146         # the major version number, as named components for version_info
147         # were apparently introduced in Python 2.7.
148         #
149         AC_MSG_CHECKING([whether $PYTHON is Python 2.5 or later])
150         python_major_version=`$PYTHON -c 'import sys; print (sys.version_info[[0]])'`
151         python_minor_version=`$PYTHON -c 'import sys; print (sys.version_info[[1]])'`
152         if test "$python_major_version" -eq 2 -a "$python_minor_version" -lt 5 ; then
153                 AC_MSG_RESULT(no)
154                 AC_MSG_WARN([Building with Python $python_major_version.$python_minor_version may not work])
155         else
156                 AC_MSG_RESULT(yes)
157         fi
158 else
159         AC_MSG_ERROR(I couldn't find python; make sure it's installed and in your path)
160 fi
161
162 dnl
163 dnl Check for yacc/lex. Distribution tarballs include generated source,
164 dnl in which case these tools are not a mandatory requirement to build.
165 dnl
166 AC_PROG_YACC
167 AS_IF([test "x$YACC" = xyacc], [AS_UNSET(YACC)])
168 AS_IF([test -z "$YACC" -a ! -f $srcdir/wiretap/ascend.c],
169         [AC_MSG_ERROR([I couldn't find bison or byacc; make sure it's installed and in your path])])
170 AM_MISSING_PROG(YACC, bison)
171 AC_PROG_LEX
172 AS_IF([test "x$LEX" != xflex], [AS_UNSET(LEX)])
173 AS_IF([test -z "$LEX" -a ! -f $srcdir/wiretap/ascend_scanner.c],
174         [AC_MSG_ERROR([I couldn't find flex; make sure it's installed and in your path])])
175 AM_MISSING_PROG(LEX, flex)
176
177 AC_PATH_PROG(POD2MAN, pod2man)
178 if test "x$POD2MAN" = x
179 then
180         #
181         # The alternative is not to build the man pages....
182         #
183         AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
184 fi
185 AC_PATH_PROG(POD2HTML, pod2html)
186 if test "x$POD2HTML" = x
187 then
188         #
189         # The alternative is not to build the HTML man pages....
190         #
191         AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
192 fi
193
194 #
195 # Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
196 # flags such as -pedantic, -W warning flags and -f feature flags.  Currently,
197 # we assume GCC and clang do; other compilers should be added here.
198 #
199 # This is done to avoid getting tripped up by compilers that support
200 # those flags but give them a different meaning.
201 #
202 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
203         ac_supports_gcc_flags=yes
204 fi
205
206 # Check for doxygen
207 AC_PATH_PROG(DOXYGEN, doxygen)
208 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
209 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
210
211 #
212 # Check for pkg-config and set PKG_CONFIG accordingly.
213 #
214 # This is referenced via AC_REQUIRE([PKG_PROG_PKG_CONFIG] in some macros
215 # like PKG_CHECK_MODULES. If the first call to such a macro is under an
216 # "if" statement, it's safer to call PKG_PROG_PKG_CONFIG directly, see
217 # the comments in acolocal.m4
218 #
219 # We want version 0.7 or better.  (XXX - explain why. Is that just
220 # because our Qt tests were originally based on AM_PATH_GTK, and *it*
221 # requires 0.7 or better?)
222 #
223 PKG_PROG_PKG_CONFIG(0.7)
224 if test -z "$PKG_CONFIG"; then
225         AC_MSG_ERROR(I couldn't find pkg-config; make sure it's installed and in your path)
226 fi
227
228 #
229 # Try to arrange for large file support.
230 #
231 AC_SYS_LARGEFILE
232
233 #
234 # Check if we need to link with libm
235 #
236 AC_SEARCH_LIBS([cos], [m])
237
238 #
239 # Check for C99 math functions.
240 #
241 AC_CHECK_FUNCS([floorl lrint])
242
243 #
244 # Check if we need to link with -lnsl and -lsocket
245 #
246 AX_LIB_SOCKET_NSL
247
248 #
249 # GUI toolkit options
250 #
251 AC_ARG_WITH([qt],
252   AC_HELP_STRING( [--with-qt=@<:@yes/no/4/5@:>@],
253                   [use Qt @<:@default=yes, if available@:>@]),
254   with_qt="$withval", with_qt="unspecified")
255
256 # GnuTLS
257 # Version 3.0 switched from LGPLv2.1+ to LGPLv3+, then switched back to
258 # LGPLv2.1+ in version 3.1.10.
259 # GnuTLS depends on GMP which switched from LGPLv2.1+ to LGPLv3+ in
260 # version 4.2.2, the switched to LGPLv3+ / GPLv2+ in version 6.0.0.
261
262 tls_message="no"
263 want_gnutls="if_available"
264 AC_ARG_WITH([gnutls],
265   AC_HELP_STRING( [--with-gnutls=@<:@yes/no@:>@],
266                   [use GnuTLS library @<:@default=yes, if available@:>@]),
267   [ with_gnutls="$withval"; want_gnutls="yes" ], with_gnutls="yes")
268
269 if test "x$with_gnutls" = "xyes"; then
270   have_license_compatible_gnutls="no"
271   PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 3.1.10 ],
272     [ have_license_compatible_gnutls="yes" ], [ echo "GnuTLS >= 3.1.10 not found " ]
273   )
274
275   if test "x$have_license_compatible_gnutls" != "xyes"; then
276     PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.0 gnutls < 3],
277       [ have_license_compatible_gnutls="yes" ] , [ echo "GnuTLS >= 2.12.0, < 3.0 not found " ]
278     )
279   fi
280
281   if test "x$have_license_compatible_gnutls" != "xyes"; then
282     if test "x$want_gnutls" = "xyes"; then
283       AC_MSG_ERROR([GnuTLS crypto library was requested, but is not installed for development])
284     else
285       AS_ECHO(["GnuTLS with compatible license not found, disabling SSL decryption"])
286     fi
287   else
288     AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use GnuTLS library])
289     tls_message="yes"
290   fi
291 fi
292
293 # libgrypt (for decryption, MAC, etc. functionality).
294 AM_PATH_LIBGCRYPT(1.4.2, [ ] , [
295   AC_MSG_ERROR([[libgcrypt not installed for development; install libgcrypt, including any development package, for your system]])
296 ])
297
298 AC_ARG_WITH(libnl,
299   AC_HELP_STRING([--with-libnl@<:@=VERSION@:>@],
300                  [use libnl (force version VERSION, if supplied) @<:@default: yes, if available@:>@]),
301 [
302         if test "x$withval" = "xno"
303         then
304                 want_libnl=no
305         elif test "x$withval" = "xyes"
306         then
307                 want_libnl=yes
308                 libnl_version=any
309         elif test "x$withval" = "x1"
310         then
311                 want_libnl=yes
312                 libnl_version=1
313         elif test "x$withval" = "x2"
314         then
315                 want_libnl=yes
316                 libnl_version=2
317         elif test "x$withval" = "x3"
318         then
319                 want_libnl=yes
320                 libnl_version=3
321         else
322                 AC_MSG_ERROR(["$withval" is not a valid argument to --with-libnl])
323         fi
324 ],[
325         #
326         # Use libnl if it's present, otherwise don't.
327         #
328         want_libnl=ifavailable
329         libnl_version=any
330 ])
331 #
332 # Libnl is Linux-specific.
333 #
334 libnl_message="no"
335 case "$host_os" in
336 linux*)
337         AC_MSG_CHECKING(whether to use libnl for various network interface purposes)
338
339         if test x$want_libnl = "xno"; then
340                 AC_MSG_RESULT(no)
341         else
342                 AC_MSG_RESULT(yes)
343                 #
344                 # Test for specific libnl versions only if no version
345                 # was specified by the user or if the version in question
346                 # was requested by the user.
347                 #
348                 if test x$libnl_version = "xany" -o x$libnl_version = "x3"; then
349                         PKG_CHECK_EXISTS([libnl-3.0 libnl-route-3.0 libnl-genl-3.0], [have_libnl3=yes], [have_libnl3=no])
350                 fi
351                 if test x$libnl_version = "xany" -o x$libnl_version = "x2"; then
352                         PKG_CHECK_EXISTS([libnl-2.0], [have_libnl2=yes], [have_libnl2=no])
353                 fi
354                 if test x$libnl_version = "xany" -o x$libnl_version = "x1"; then
355                         PKG_CHECK_EXISTS([libnl-1], [have_libnl1=yes], [have_libnl1=no])
356                 fi
357                 if (test "${have_libnl3}" = "yes"); then
358                         PKG_WIRESHARK_CHECK_SYSTEM_MODULES([LIBNL], [libnl-3.0 libnl-route-3.0 libnl-genl-3.0])
359                         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
360                         AC_DEFINE(HAVE_LIBNL3, 1, [libnl version 3])
361                         libnl_message="yes (v3)"
362                 elif (test "${have_libnl2}" = "yes"); then
363                         PKG_WIRESHARK_CHECK_SYSTEM_MODULES([LIBNL], [libnl-2.0])
364                         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
365                         AC_DEFINE(HAVE_LIBNL2, 1, [libnl version 2])
366                         libnl_message="yes (v2)"
367                 elif (test "${have_libnl1}" = "yes"); then
368                         PKG_WIRESHARK_CHECK_SYSTEM_MODULES([LIBNL], [libnl-1])
369                         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
370                         AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
371                         libnl_message="yes (v1)"
372                 else
373                         if test x$want_libnl = "xyes"; then
374                                 case "$libnl_version" in
375
376                                 any)
377                                         AC_MSG_ERROR("I couldn't find libnl even though you manually enabled it.")
378                                         ;;
379
380                                 *)
381                                         AC_MSG_ERROR("I couldn't find libnl version $libnl_version even though you manually enabled it.")
382                                         ;;
383                                 esac
384                         fi
385                 fi
386         fi
387
388         AC_MSG_CHECKING([if nl80211.h is new enough])
389           AC_TRY_COMPILE([#include <linux/nl80211.h>],
390             [int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER;
391              x |= NL80211_ATTR_SUPPORTED_IFTYPES;
392              x |= NL80211_ATTR_SUPPORTED_COMMANDS;
393              x |= NL80211_ATTR_WIPHY_FREQ;
394              x |= NL80211_CHAN_NO_HT;
395              (void)x;],
396             [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211, 1, [nl80211.h is new enough])],
397             [AC_MSG_RESULT(no)])
398
399         AC_MSG_CHECKING([for NL80211_SET_CHANNEL])
400           AC_TRY_COMPILE([#include <linux/nl80211.h>],
401             [enum nl80211_commands x = NL80211_CMD_SET_CHANNEL;],
402             [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_CMD_SET_CHANNEL, 1, [SET_CHANNEL is supported])],
403             [AC_MSG_RESULT(no)])
404
405         AC_MSG_CHECKING([for NL80211_SPLIT_WIPHY_DUMP])
406           AC_TRY_COMPILE([#include <linux/nl80211.h>],
407             [enum nl80211_protocol_features x = NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP;],
408             [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_SPLIT_WIPHY_DUMP, 1, [SPLIT_WIPHY_DUMP is supported])],
409             [AC_MSG_RESULT(no)])
410
411         AC_MSG_CHECKING([for NL80211_VHT_CAPABILITY])
412           AC_TRY_COMPILE([#include <linux/nl80211.h>],
413             [enum nl80211_attrs x = NL80211_ATTR_VHT_CAPABILITY;],
414             [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_VHT_CAPABILITY, 1, [VHT_CAPABILITY is supported])],
415             [AC_MSG_RESULT(no)])
416         ;;
417
418 *)
419         if test x$want_libnl != "xno" -a x$want_libnl != "xifavailable"; then
420                 AC_MSG_WARN([libnl is Linux-specific, ignoring --with-libnl])
421         fi
422 esac
423
424 #
425 # Check if we should build the Wireshark User's Guide
426 #
427 AC_ARG_ENABLE(guides,
428   AC_HELP_STRING( [--disable-guides],
429                   [Don't build the Wireshark User's Guide]),
430                   [want_wsug=$enableval], [want_wsug=if_available])
431
432 #
433 # Check for programs used when building DocBook documentation.
434 #
435 have_wsug=yes
436 AC_PATH_PROGS(ASCIIDOCTOR, [asciidoctorj asciidoctor])
437 AC_CHECK_PROGS(HAVE_ASCIIDOCTOR, [asciidoctorj asciidoctor], "yes", "no")
438 AM_CONDITIONAL(HAVE_ASCIIDOCTOR, test x$HAVE_ASCIIDOCTOR = xyes)
439 AS_IF([test ! -x "$ASCIIDOCTOR"],
440         [
441           AS_IF([test "x$want_wsug" = xyes],
442                 [AC_MSG_ERROR([Asciidoctor not found. This is required to build the release notes and guides])])
443           have_wsug=no
444         ])
445 AC_PATH_PROG(XSLTPROC, xsltproc, xsltproc)
446 AS_IF([test ! -x "$XSLTPROC"],
447         [
448           AS_IF([test "x$want_wsug" = xyes],
449                 [AC_MSG_ERROR([xlstproc not found but required to build the Wireshark User's Guide])])
450           have_wsug=no
451         ])
452
453 AM_CONDITIONAL(BUILD_USER_GUIDE, [test "x$have_wsug" = xyes -a "x$want_wsug" != xno])
454
455 # RPM
456 AC_CHECK_PROGS(RPMBUILD, [rpmbuild], [rpmbuild])
457
458 # Shellcheck
459 AC_CHECK_PROG(SHELLCHECK, shellcheck)
460
461 #
462 # Check compiler vendor. For GCC this will be 'gnu' and for Clang 'clang'.
463 #
464 AX_COMPILER_VENDOR
465 if test "x$CXX" != "x" ; then
466         AC_LANG_PUSH(C++)
467         AX_COMPILER_VENDOR
468         AC_LANG_POP
469 fi
470
471 #
472 # Some compilers have to be told to fail when passed an unknown -W flag;
473 # make sure we do that.
474 #
475 AC_WIRESHARK_CHECK_UNKNOWN_WARNING_OPTION_ERROR
476
477 #
478 # Some C++ compilers have to be told to fail when passed a -W flag that
479 # they don't think should apply to C++; make sure we do that.
480 #
481 AC_WIRESHARK_CHECK_NON_CXX_WARNING_OPTION_ERROR
482
483 #
484 # The following are for C and C++
485 #
486 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wall)
487 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wextra)
488 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wendif-labels)
489 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpointer-arith)
490 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wformat-security)
491 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fwrapv)
492 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-strict-overflow)
493 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-delete-null-pointer-checks)
494 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wvla)
495 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Waddress)
496 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wattributes)
497 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdiv-by-zero)
498 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wignored-qualifiers)
499 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpragmas)
500 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-overlength-strings)
501 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-long-long)
502 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wheader-guard)
503 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcomma)
504
505 #
506 # The following are C only, not C++
507 #
508 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wc++-compat, C)
509 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunused-const-variable, C)
510
511 #
512 # XXX - OK for C++?
513 #
514 # Make sure -Wshadow doesn't complain about variables in function and
515 # function pointer declarations shadowing other variables; if not, don't
516 # turn it on, as some versions of GCC (including the one in at least
517 # some Xcode versions that came with Mac OS X 10.5) complain about
518 # that.
519 #
520 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshadow, C,
521   [
522 extern int bar(int a);
523 extern int foo(int);
524
525 int
526 foo(int a)
527 {
528         int (*fptr)(int a) = bar;
529
530         return fptr(a) * 2;
531 }
532   ],
533   [warns about variables in function declarations shadowing other variables])
534
535 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-pointer-sign, C)
536 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wold-style-definition, C)
537 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wstrict-prototypes, C)
538
539 # Unfortunately some versions of gcc generate logical-op warnings when strchr()
540 # is given a constant string.
541 # gcc versions 4.3.2 and 4.4.5 are known to have the problem.
542 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wlogical-op, C,
543   [
544 #include <string.h>
545
546 int foo(const char *, int);
547 int bar(void);
548
549 int
550 foo(const char *sep, int c)
551 {
552         if (strchr (sep, c) != NULL)
553                 return 1;
554         else
555                 return 0;
556 }
557
558 int
559 bar(void)
560 {
561         return foo("<", 'a');
562 }
563   ],
564   [generates warnings from strchr()])
565
566 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wjump-misses-init, C)
567 # The Qt headers generate a ton of shortening errors on 64-bit systems
568 # so only enable this for C for now.
569 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wshorten-64-to-32, C)
570
571 #
572 # Implicit function declarations are an error in C++ and most
573 # likely a programming error in C. Turn -Wimplicit-int and
574 # -Wimplicit-function-declaration into an error by default.
575 #
576 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Werror=implicit, C)
577
578 # Clang only. Avoid "argument unused during compilation" warnings
579 # (for example, when getting the -gsplit-dwarf option or
580 # when combining -fwrapv with -fno-strict-overflow)
581 if test x"$ax_cv_c_compiler_vendor" = xclang; then
582         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments, C)
583 fi
584 if test x"$ax_cv_cxx_compiler_vendor" = xclang; then
585         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Qunused-arguments, CXX)
586 fi
587
588 #
589 # Use the faster pre gcc 4.5 floating point precision if available.
590 #
591 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fexcess-precision=fast)
592
593 #
594 # Try to have the compiler default to hiding symbols, so that only
595 # symbols explicitly exported with WS_DLL_PUBLIC will be visible
596 # outside (shared) libraries; that way, more UN*X builds will catch
597 # failures to export symbols, rather than having that fail only on
598 # Windows.
599 #
600 # GCC and GCC-compatible compilers
601 #
602 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fvisibility=hidden)
603 if test "x$can_add_to_cflags" = "xno"
604 then
605         #
606         # Sun^WOracle C.
607         #
608         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xldscope=hidden)
609         if test "x$can_add_to_cflags" = "xno"
610         then
611                 # TODO add other ways of hiding symbols
612                 AC_MSG_WARN(Compiler will export all symbols from shared libraries)
613         fi
614 fi
615
616 #
617 # Try to add some additional checks to CFLAGS.
618 # These are not enabled by default, because the warnings they produce
619 # are very hard or impossible to eliminate.
620 #
621 AC_ARG_ENABLE(extra-compiler-warnings,
622   AC_HELP_STRING( [--enable-extra-compiler-warnings],
623                   [do additional compiler warnings @<:@default=no@:>@]),
624 [
625         wireshark_extra_flags=$enableval
626         if test $enableval != no
627         then
628                 #
629                 # The following are for C and C++
630                 #
631                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wpedantic)
632                 #
633                 # As we use variadic macros, we don't want warnings
634                 # about them, even with -Wpedantic.
635                 #
636                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wno-variadic-macros)
637                 #
638                 # Various code blocks this one.
639                 #
640                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Woverflow)
641                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
642                 #
643                 # Due to various places where APIs we don't control
644                 # require us to cast away constness, we can probably
645                 # never enable this one with -Werror.
646                 #
647                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-qual)
648                 #
649                 # Some generated ASN.1 dissectors block this one;
650                 # multiple function declarations for the same
651                 # function are being generated.
652                 #
653                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wredundant-decls)
654                 #
655                 # Some loops are safe, but it's hard to convince the
656                 # compiler of that.
657                 #
658                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunsafe-loop-optimizations)
659                 #
660                 # All the registration functions block these for now.
661                 #
662                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-prototypes)
663                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wmissing-declarations)
664                 #
665                 # A bunch of "that might not work on SPARC" code blocks
666                 # this one for now; some of it is code that *will* work
667                 # on SPARC, such as casts of "struct sockaddr *" to
668                 # "struct sockaddr_in *", which are required by some
669                 # APIs such as getifaddrs().
670                 #
671                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wcast-align)
672                 #
673                 # Works only with Clang
674                 #
675                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wunreachable-code)
676                 #
677                 # Works only with Clang but generates a lot of warnings
678                 # (about glib library not using Doxygen)
679                 #
680                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wdocumentation)
681                 #
682                 # Works only with GCC 7
683                 #
684                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wduplicated-branches)
685
686                 #
687                 # The following are C only, not C++
688                 #
689                 # Due to various places where APIs we don't control
690                 # require us to cast away constness, we can probably
691                 # never enable this one with -Werror.
692                 #
693                 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-Wbad-function-cast, C)
694         fi
695 ])
696
697 # Try to add ASAN address analyze.
698 # Only needed for analyse
699 #
700 AC_ARG_ENABLE(asan,
701   AC_HELP_STRING( [--enable-asan],
702                   [Enable AddressSanitizer (ASAN) for debugging (degrades performance)@<:@default=no@:>@]),
703 [
704         #
705         # With Clang >= 3.5 Leak detection is enable by default
706         # and no yet all leak is fixed...
707         # use ASAN_OPTIONS=detect_leaks=0 to disable detect_leaks
708         #
709         # XXX shouldn't this also be added to LDFLAGS?
710         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=address)
711
712         # Disable ASAN for build-time tools, e.g. lemon
713         WS_CFLAGS_saved="$WS_CFLAGS"
714         WS_LDFLAGS_saved="$WS_LDFLAGS"
715         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fno-sanitize=all, C)
716         if test "x$can_add_to_cflags" = "xyes"
717         then
718                 NO_SANITIZE_CFLAGS="-fno-sanitize=all"
719                 NO_SANITIZE_LDFLAGS="-fno-sanitize=all"
720         fi
721         WS_CFLAGS="$WS_CFLAGS_saved"
722         WS_LDFLAGS="$WS_LDFLAGS_saved"
723
724 ])
725 AC_SUBST(NO_SANITIZE_CFLAGS)
726 AC_SUBST(NO_SANITIZE_LDFLAGS)
727
728 # Try to enable ThreadSanitizer.
729 #
730 AC_ARG_ENABLE(tsan,
731   AC_HELP_STRING( [--enable-tsan],
732                   [Enable ThreadSanitizer (TSan) for debugging@<:@default=no@:>@]),
733 [
734         #
735         # Available since Clang >= 3.2 and GCC >= 4.8
736         #
737         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=thread)
738         AC_WIRESHARK_LDFLAGS_CHECK(-fsanitize=thread)
739
740 ])
741
742 # Try to enable UndefinedBehaviorSanitizer.
743 #
744 AC_ARG_ENABLE(ubsan,
745   AC_HELP_STRING( [--enable-ubsan],
746                   [Enable UndefinedBehaviorSanitizer (UBSan) for debugging@<:@default=no@:>@]),
747 [
748         #
749         # Available since Clang >= 3.3 and GCC >= 4.9
750         #
751         # XXX shouldn't this also be added to LDFLAGS?
752         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fsanitize=undefined)
753
754 ])
755
756 # Add check hf conflict..
757 #
758 AC_ARG_ENABLE(checkhf-conflict,
759   AC_HELP_STRING( [--enable-checkhf-conflict],
760                   [Enable hf conflict check for debugging (start-up may be slower)@<:@default=no@:>@]),
761 [
762         AC_DEFINE(ENABLE_CHECK_FILTER, 1, [Enable hf conflict check])
763 ])
764
765 AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
766 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,-M])
767 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--cref])
768 # AC_WIRESHARK_LDFLAGS_CHECK([-flto])
769 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhopr])
770 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhole-program])
771
772 #
773 # Put -fPIE in PIE_CFLAGS and -pie in PIE_LDFLAGS if we can use them,
774 # so that we can build dumpcap PIE - it may run with elevated
775 # privileges, and using PIE means the OS can run it at random locations
776 # in the address space to make attacks more difficult.
777 #
778
779 WS_CFLAGS_saved="$WS_CFLAGS"
780 WS_LDFLAGS_saved="$WS_LDFLAGS"
781 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-fPIE, C)
782 if test "x$can_add_to_cflags" = "xyes"
783 then
784         AC_WIRESHARK_LDFLAGS_CHECK([-fPIE -pie])
785         if test "x$can_add_to_ldflags" = "xyes"
786         then
787                 # We can use PIE
788                 PIE_CFLAGS="-fPIE"
789                 PIE_LDFLAGS="-pie"
790         fi
791 fi
792 WS_CFLAGS="$WS_CFLAGS_saved"
793 WS_LDFLAGS="$WS_LDFLAGS_saved"
794 AC_SUBST(PIE_CFLAGS)
795 AC_SUBST(PIE_LDFLAGS)
796
797 WS_CFLAGS_saved="$WS_CFLAGS"
798 AC_WIRESHARK_COMPILER_FLAGS_CHECK(-msse4.2, C)
799 if test "x$can_add_to_cflags" = "xyes"
800 then
801         #
802         # The compiler supports -msse4.2; use that to enable SSE 4.2.
803         #
804         # We only want to apply -msse4.2 to
805         # wsutil/ws_mempbrk_sse42.c, as the SSE4.2 code there
806         # is run only if the hardware supports it, but other
807         # code would do no such checks.
808         #
809         ac_sse4_2_flag=-msse4.2
810 else
811         #
812         # Try -xarch=sse4_2; that's the flag for Sun's compiler.
813         #
814         AC_WIRESHARK_COMPILER_FLAGS_CHECK(-xarch=sse4_2, C)
815         if test "x$can_add_to_cflags" = "xyes"
816         then
817                 #
818                 # The compiler supports -xarch=sse4_2; use that to
819                 # enable SSE 4.2.
820                 ac_sse4_2_flag=-xarch=sse4_2
821         fi
822 fi
823 WS_CFLAGS="$WS_CFLAGS_saved"
824
825 if test "x$ac_sse4_2_flag" != x; then
826         #
827         # OK, we have a compiler flag to enable SSE 4.2.
828         #
829         # Make sure we have the necessary headers for the SSE4.2 intrinsics
830         # and that we can use them.
831         #
832         # First, check whether we have emmintrin.h and can use it
833         # *without* the SSE 4.2 flag.
834         #
835         AC_MSG_CHECKING([whether there is emmintrin.h header and we can use it])
836         AC_TRY_COMPILE(
837                 [#include <emmintrin.h>],
838                 [return 0;],
839                 [
840                         emmintrin_h_works=yes
841                         AC_MSG_RESULT([yes])
842                 ],
843                 [
844                         emmintrin_h_works=no
845                         AC_MSG_RESULT([no])
846                 ]
847         )
848
849         #
850         # OK, if that works, see whether we have nmmintrin.h and
851         # can use it *with* the SSE 4.2 flag.
852         #
853         if test "x$emmintrin_h_works" = "xyes"; then
854                 #
855                 # Add the SSE4.2 flags to the beginning of CFLAGS,
856                 # in case the user explicitly specified -mno-sse4.2
857                 # (or in case Gentoo's build tools did so); if they
858                 # did so, we only want this to work if we can use
859                 # the #pragma to override that for ws_mempbrk_sse42.c,
860                 # and putting it at the beginning means that the
861                 # CFLAGS setting in the environment will come later
862                 # and override it.
863                 #
864                 AC_MSG_CHECKING([whether there is nmmintrin.h header and we can use it])
865                 saved_CFLAGS="$CFLAGS"
866                 CFLAGS="$ac_sse4_2_flag $WS_CFLAGS $CFLAGS"
867                 AC_TRY_COMPILE(
868                         [#include <nmmintrin.h>],
869                         [return 0;],
870                         [
871                                 have_sse42=yes
872                                 AC_DEFINE(HAVE_SSE4_2, 1, [Support SSSE4.2 (Streaming SIMD Extensions 4.2) instructions])
873                                 CFLAGS_SSE42="$ac_sse4_2_flag"
874                                 AC_MSG_RESULT([yes])
875                         ],
876                         [
877                                 have_sse42=no
878                                 AC_MSG_RESULT([no])
879                         ]
880                 )
881                 CFLAGS="$saved_CFLAGS"
882         else
883                 have_sse42=no
884         fi
885 else
886         have_sse42=no
887 fi
888 dnl build libwsutil_sse42 only if there is SSE4.2
889 AM_CONDITIONAL(SSE42_SUPPORTED, test "x$have_sse42" = "xyes")
890 AC_SUBST(CFLAGS_SSE42)
891
892 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
893 #  (only if the GCC 'optimization level' > 0).
894 #
895 # See: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
896 # See: http://sourceware.org/bugzilla/show_bug.cgi?id=13979
897 #
898 # Note: FORTIFY_SOURCE is only effective for gcc optimization level > 0 (-O1, etc)
899 AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK
900
901 #
902 # If the compiler supports GCC-style flags, enable a barrier "stop on
903 # warning".
904 # This barrier is set for a very large part of the code. However, it is
905 # typically not set for "generated" code  (flex, ans2wrs, idl2wrs, ...)
906 #
907 warnings_as_errors_default="yes"
908 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
909 AC_ARG_ENABLE(warnings-as-errors,
910   AC_HELP_STRING( [--enable-warnings-as-errors],
911                   [treat warnings as errors (only for GCC or clang) @<:@default=yes, unless extra compiler warnings are enabled@:>@]),
912 [
913   if test "x$ac_supports_gcc_flags" = "xyes" -a "x$enableval" = "xyes"; then
914     with_warnings_as_errors="yes"
915     AC_MSG_RESULT(yes)
916   else
917     with_warnings_as_errors="no"
918     AC_MSG_RESULT(no)
919   fi
920 ],
921 [
922   if test "x$ac_supports_gcc_flags" = "xyes" -a "x$wireshark_extra_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
923     with_warnings_as_errors="yes"
924     AC_MSG_RESULT(yes)
925   else
926     with_warnings_as_errors="no"
927     AC_MSG_RESULT(no)
928   fi
929 ])
930
931 AS_IF([test "x$with_warnings_as_errors" = "xyes"], [WERROR="-Werror"], [WERROR=""])
932 AC_SUBST(WERROR)
933 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, [test "x$with_warnings_as_errors" = "xyes"])
934
935 #
936 # Add any platform-specific compiler flags needed.
937 #
938 AC_MSG_CHECKING(for platform-specific compiler flags)
939 if test "x$GCC" = "xyes" ; then
940         #
941         # GCC - do any platform-specific tweaking necessary.
942         #
943         case "$host_os" in
944         solaris*)
945                 # the X11 headers don't automatically include prototype info
946                 # and a lot don't include the return type
947                 WS_CPPFLAGS="$WS_CPPFLAGS -DFUNCPROTO=15"
948                 WS_CFLAGS="$WS_CFLAGS -Wno-return-type"
949                 WS_CXXFLAGS="$WS_CXXFLAGS -Wno-return-type"
950                 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
951                 ;;
952         *)
953                 AC_MSG_RESULT(none needed)
954                 ;;
955         esac
956 else
957         #
958         # Not GCC - assume it's the vendor's compiler.
959         #
960         case "$host_os" in
961         hpux*)
962                 #
963                 # AC_PROG_CC_STDC should already have added whatever
964                 # flags are necessary for ISO C - C99 if available,
965                 # otherwise C89 - with extensions.
966                 #
967                 # Add +O2, for optimization, as suggested by Jost Martin.
968                 # XXX - works with "-g"?
969                 #
970                 # +O2 is supported both by the C and C++ compiler.
971                 #
972                 # Add -Wp,-H200000 to handle some large #defines we
973                 # have; that flag is not necessary for the C++
974                 # compiler unless the "legacy" C++ preprocessor is
975                 # being used (+legacy_cpp).  We don't want the
976                 # legacy preprocessor if it's not the default,
977                 # so we just add -Wp,-H200000 to the C flags.
978                 # (If there are older versions of aC++ that only
979                 # support the legacy preprocessor, and require
980                 # that we boost the table size, we'd have to check
981                 # whether -Wp,-H200000 is supported by the C++
982                 # compiler and add it only if it is.)
983                 #
984                 WS_CFLAGS="+O2 -Wp,-H200000 $WS_CFLAGS"
985                 if test "$CC" = "$CC_FOR_BUILD"; then
986                         #
987                         # We're building the build tools with the same
988                         # compiler as the one with which we're building
989                         # Wireshark, so add the flags to the flags for
990                         # that compiler as well.
991                         #
992                         CFLAGS_FOR_BUILD="-Ae +O2 -Wp,-H200000 $CFLAGS"
993                 fi
994                 WS_CXXFLAGS="+O2 $WS_CXXFLAGS"
995                 AC_MSG_RESULT(HP C/C++ compiler - added +O2 -Wp,-H200000)
996                 ;;
997         solaris*)
998                 #
999                 # Crank up the warning level.
1000                 #
1001                 WS_CFLAGS="$WS_CFLAGS -v"
1002                 WS_CXXFLAGS="$WS_CXXFLAGS +w2"
1003                 ;;
1004         *)
1005                 AC_MSG_RESULT(none needed)
1006                 ;;
1007         esac
1008 fi
1009
1010 #
1011 # Add any platform-specific linker flags needed.
1012 #
1013 AC_MSG_CHECKING(for platform-specific linker flags)
1014 case "$host_os" in
1015 aix*)
1016         #
1017         # If this is GCC or Clang, Add -Wl,-bbigtoc for big libraries.
1018         # XXX - what if we're using xlc?  Is that necessary?  The
1019         # xlc 7.0 manual says "Specifying -qpic=large has the same
1020         # effect as passing -bbigtoc to ld"; do we need to tell xlc,
1021         # when it's compiling, to generate different code for a large
1022         # TOC, or is that just a linker flag?  For that matter, do we
1023         # have to tell GCC or Clang to generate different code for a
1024         # large TOC?
1025         #
1026         if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
1027                 LDFLAGS_BIGSHAREDLIB="-Wl,-bbigtoc"
1028                 AC_MSG_RESULT([AIX linker with GCC or Clang - added -Wl,-bbigtoc to large shared library linker flags and -Wl,-headerpad_max_install_names -Wl,-search_paths_first and -Wl,-headerpad_max_install_names to all linker flags])
1029         fi
1030         ;;
1031 darwin*)
1032         #
1033         # Add -Wl,-single_module to the LDFLAGS used with shared
1034         # libraries, to fix some error that show up in some cases;
1035         # some Apple documentation recommends it for most shared
1036         # libraries.
1037         #
1038         LDFLAGS_SHAREDLIB="-Wl,-single_module"
1039         #
1040         # Add -Wl,-headerpad_max_install_names to the LDFLAGS, as
1041         # code-signing issues is running out of padding space.
1042         #
1043         # Add -Wl,-search_paths_first to make sure that if we search
1044         # directories A and B, in that order, for a given library, a
1045         # non-shared version in directory A, rather than a shared
1046         # version in directory B, is chosen (so we can use
1047         # --with-pcap=/usr/local to force all programs to be linked
1048         # with a static version installed in /usr/local/lib rather than
1049         # the system version in /usr/lib).
1050         #
1051         WS_LDFLAGS="-Wl,-headerpad_max_install_names -Wl,-search_paths_first $WS_LDFLAGS"
1052         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])
1053         ;;
1054 cygwin*)
1055         #
1056         # Shared libraries in cygwin/Win32 must never contain
1057         # undefined symbols.
1058         #
1059         WS_LDFLAGS="$WS_LDFLAGS -no-undefined"
1060         AC_MSG_RESULT(Cygwin GNU ld - added -no-undefined)
1061         ;;
1062 *)
1063         AC_MSG_RESULT(none needed)
1064         ;;
1065 esac
1066 AC_SUBST(LDFLAGS_BIGSHAREDLIB)
1067 AC_SUBST(LDFLAGS_SHAREDLIB)
1068
1069 #
1070 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
1071 # link directory.
1072 #
1073 case "$host_os" in
1074   solaris*)
1075     AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
1076     if test x$LD_LIBRARY_PATH != x ; then
1077       LIBS="$LIBS -R$LD_LIBRARY_PATH"
1078       AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
1079     else
1080       AC_MSG_RESULT(no -- this may be a problem in a few seconds)
1081     fi
1082   ;;
1083 esac
1084
1085 # Enable/disable wireshark
1086 AC_ARG_ENABLE(wireshark,
1087   AC_HELP_STRING( [--enable-wireshark],
1088                   [build the Wireshark GUI (with Gtk+, Qt, or both) @<:@default=yes@:>@]),
1089     enable_wireshark=$enableval,enable_wireshark=yes)
1090 AM_CONDITIONAL(BUILDING_WIRESHARK, test x$enable_wireshark = xyes)
1091
1092 GLIB_MIN_VERSION=2.32.0
1093 AC_SUBST(GLIB_MIN_VERSION)
1094 # GLib checks; we require GLib $GLIB_MIN_VERSION or later, and require gmodule
1095 # support, as we need that for dynamically loading plugins.
1096 #
1097 # Release dates for GLib versions:
1098 # 2.14.0: 03 Aug 2007
1099 # 2.16.0: 10 Mar 2008
1100 # 2.18.0: 02 Sep 2008
1101 # 2.20.0: 13 Mar 2009
1102 # 2.22.0: 22 Sep 2009
1103 # 2.24.0: 28 Mar 2010
1104 # 2.26.0: 27 Sep 2010
1105 # 2.28.0: 08 Feb 2011
1106 # 2.30.0: 27 Sep 2011
1107 # 2.32.0: 24 Mar 2012
1108 # 2.34.0: 24 Sep 2012
1109 # 2.36.0: 25 Mar 2013
1110 # 2.38.0: 23 Sep 2013
1111 # 2.40.0: 24 Mar 2014
1112 # 2.42.0: 22 Sep 2014
1113 # 2.44.0: 23 Mar 2014
1114 # 2.46.0: 25 Sep 2015
1115
1116 PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GLIB],
1117         [glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
1118         [GLIB_VERSION=`$PKG_CONFIG --modversion glib-2.0`],
1119         [AC_MSG_ERROR([GLib $GLIB_MIN_VERSION or later not found.])])
1120
1121 # Error out if a glib header other than a "top level" header
1122 #  (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
1123 #  is used.
1124 AX_APPEND_FLAG([-DG_DISABLE_SINGLE_INCLUDES], [GLIB_CONFIG])
1125
1126 # Error out on the usage of deprecated glib functions
1127 AX_APPEND_FLAG([-DG_DISABLE_DEPRECATED], [GLIB_CONFIG])
1128
1129 GLIB_CFLAGS="$GLIB_CONFIG $GLIB_CFLAGS"
1130 AC_SUBST(GLIB_CFLAGS)
1131 AC_SUBST(GLIB_LIBS)
1132
1133 GTK2_MIN_VERSION=2.12.0
1134 AC_SUBST(GTK2_MIN_VERSION)
1135 GTK3_MIN_VERSION=3.0.0
1136 AC_SUBST(GTK3_MIN_VERSION)
1137 QT_MIN_VERSION=5.2.0
1138 AC_SUBST(QT_MIN_VERSION)
1139 # GTK+ and Qt checks; we require GTK+ $GTK2_MIN_VERSION or later or
1140 # GTK3_MIN_VERSION or later or Qt $QT_MIN_VERSION or later.
1141 #
1142 # We only do those if we're going to be building Wireshark;
1143 # otherwise, we don't have any GUI to build, so we don't use
1144 # GTK+ or Qt.
1145 #
1146 # We don't add $GTK_LIBS or $Qt_LIBS to LIBS, because we don't want to
1147 # force all programs to be built with GTK+ or Qt.
1148 #
1149 # For a list of library versions and their support across different platforms,
1150 # see https://wiki.wireshark.org/Development/Support_library_version_tracking
1151
1152 have_qt=no
1153 have_gtk=no
1154 if test "x$enable_wireshark" = "xyes"; then
1155         if test "x$with_qt" != "xno"; then
1156                 #
1157                 # Qt was specified; make sure we have a C++ compiler.
1158                 #
1159                 if test -z "$CXX"; then
1160                         AC_MSG_ERROR(Need a working C++ compiler to build Wireshark with Qt)
1161                 fi
1162
1163                 #
1164                 # Now make sure we have Qt and, if so, add the flags
1165                 # for it to CFLAGS and CXXFLAGS.
1166                 #
1167                 AC_WIRESHARK_QT_CHECK($QT_MIN_VERSION, "$with_qt",
1168                 [
1169                         AC_SUBST(Qt_CFLAGS)
1170                         AC_SUBST(Qt_LIBS)
1171                         have_qt=yes
1172                         GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-qt"
1173
1174                         #
1175                         # We're building with Qt, so we need the Qt build
1176                         # tools in order to build the Wireshark GUI.
1177                         # We've found a particular major version of Qt,
1178                         # and we want that version's build tools; for
1179                         # example, the Qt 4 version of uic produces files
1180                         # that include Qt headers with paths that work
1181                         # with Qt 4 but not Qt 5, so we can't use the
1182                         # Qt 4 version of uic if we're building with Qt 5.
1183                         AC_WIRESHARK_QT_TOOL_CHECK(UIC, uic, "$qt_version")
1184                         AC_SUBST(UIC)
1185                         AC_WIRESHARK_QT_TOOL_CHECK(MOC, moc, "$qt_version")
1186                         AC_SUBST(MOC)
1187                         AC_WIRESHARK_QT_TOOL_CHECK(RCC, rcc, "$qt_version")
1188                         AC_SUBST(RCC)
1189                         AC_WIRESHARK_QT_TOOL_CHECK_LRELEASE("$qt_version")
1190                         AC_SUBST(LRELEASE)
1191
1192                         #
1193                         # On Darwin, make sure we're using Qt5 or later.
1194                         # If so, find where the Qt frameworks are located
1195                         # and add that to the rpath, just in case this is
1196                         # Qt 5.5 or later and the frameworks have an
1197                         # install name that begins with @rpath and aren't
1198                         # installed in a frameworks directory that's
1199                         # searched by default.
1200                         #
1201                         case "$host_os" in
1202                         darwin*)
1203                                 if test $qt_version -le 4
1204                                 then
1205                                         AC_MSG_ERROR([macOS builds should use Qt5])
1206                                 else
1207                                         Qt_LDFLAGS="-Wl,-rpath,"`$PKG_CONFIG --libs Qt${qt_version}Core | sed -e 's/-F//' -e 's/ -framework.*//'`
1208                                 fi
1209                                 ;;
1210                         esac
1211                         AC_SUBST(Qt_LDFLAGS)
1212
1213                         if test -z "${MOC_OPTIONS+1}"
1214                         then
1215                                 # Squelch moc verbose "nothing to do" output
1216                                 if test $QT_VERSION_MAJOR -eq 5
1217                                 then
1218                                         MOC_OPTIONS="-nn"
1219                                 elif test $QT_VERSION_MAJOR -eq 4 -a $QT_VERSION_MINOR -ge 8
1220                                 then
1221                                         MOC_OPTIONS="-nn"
1222                                 fi
1223                         fi
1224                         AC_SUBST(MOC_OPTIONS)
1225                 ],
1226                 [
1227                         case "$with_qt" in
1228
1229                         unspecified)
1230                                 #
1231                                 # They didn't explicitly ask for Qt,
1232                                 # so just don't build with it.
1233                                 #
1234                                 ;;
1235
1236                         yes)
1237                                 case "$host_os" in
1238                                 darwin*)
1239                                         #
1240                                         # This is probably macOS, and the
1241                                         # problem could be that this is a
1242                                         # later version of Qt that doesn't
1243                                         # install .pc files on macOS, so
1244                                         # pkg-config can't find it.
1245                                         #
1246                                         AC_MSG_ERROR([Qt is not installed or may not work with the configure script; try using CMake, instead])
1247                                         ;;
1248
1249                                 *)
1250                                         #
1251                                         # Qt might be installed, but only
1252                                         # for use by applications, not
1253                                         # for development.
1254                                         #
1255                                         AC_MSG_ERROR([Qt is not installed for development])
1256                                         ;;
1257                                 esac
1258                                 ;;
1259
1260                         4)
1261                                 case "$host_os" in
1262                                 darwin*)
1263                                         #
1264                                         # See above.
1265                                         #
1266                                         AC_MSG_ERROR([Qt 4 is not installed or may not work with the configure script; try using CMake, instead])
1267                                         ;;
1268
1269                                 *)
1270                                         #
1271                                         # See above.
1272                                         #
1273                                         AC_MSG_ERROR([Qt 4 is not installed for development])
1274                                         ;;
1275                                 esac
1276                                 ;;
1277
1278                         5)
1279                                 case "$host_os" in
1280                                 darwin*)
1281                                         #
1282                                         # See above.
1283                                         #
1284                                         AC_MSG_ERROR([Qt 5 is not installed or may not work with the configure script; try using CMake, instead])
1285                                         ;;
1286
1287                                 *)
1288                                         #
1289                                         # See above.
1290                                         #
1291                                         AC_MSG_ERROR([Qt 5 is not installed for development])
1292                                         ;;
1293                                 esac
1294                                 ;;
1295                         esac
1296                 ])
1297         fi
1298
1299         for want_gtk_version in $with_gtk; do
1300                 AS_CASE([$want_gtk_version],
1301                   [3], [PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
1302                         [gtk+-3.0 >= $GTK3_MIN_VERSION glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
1303                         [
1304                           have_gtk=yes
1305                           GTK_VERSION=`$PKG_CONFIG --modversion gtk+-3.0`
1306                           GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk=3"
1307                         ],
1308                         [
1309                           :
1310                         ])],
1311                   [2], [PKG_WIRESHARK_CHECK_SYSTEM_MODULES([GTK],
1312                         [gtk+-2.0 >= $GTK2_MIN_VERSION glib-2.0 >= $GLIB_MIN_VERSION gthread-2.0 >= $GLIB_MIN_VERSION gmodule-2.0 >= $GLIB_MIN_VERSION],
1313                         [
1314                           have_gtk=yes
1315                           GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
1316                           GUI_CONFIGURE_FLAGS="$GUI_CONFIGURE_FLAGS --with-gtk=2"
1317                         ],
1318                         [
1319                           :
1320                         ])],
1321                   [fail3], [AC_MSG_ERROR([GTK+ 3 was requested but is not installed for development])],
1322                   [fail2], [AC_MSG_ERROR([GTK+ 2 was requested but is not installed for development])],
1323                   [fail],  [AC_MSG_ERROR([GTK+ was requested but is not installed for development])])
1324
1325                 AS_IF([test "x$have_gtk" = xyes], [break])
1326         done
1327
1328         if test "$have_gtk" = "yes" ; then
1329                 # If we're building with GTK, complain and then add flags for it
1330                 #
1331                 AC_MSG_WARN([The GTK+ UI is deprecated and will be removed in a future release.])
1332
1333                 # GLib flags
1334                 #
1335                 GTK_CONFIG="$GLIB_CONFIG"
1336
1337                 gtk_major_version=`echo $GTK_VERSION | cut -d. -f1`
1338                 gtk_minor_version=`echo $GTK_VERSION | cut -d. -f2`
1339
1340                 AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATED], [GTK_CONFIG])
1341                 if test \( $gtk_major_version -eq 3 -a $gtk_minor_version -ge 10 \) ; then
1342                         ## Allow use of deprecated & disable deprecated warnings if Gtk >= 3.10;
1343                         ##  The deprecations in Gtk 3.10 will not be fixed ...
1344                         AX_APPEND_FLAG([-DGDK_DISABLE_DEPRECATION_WARNINGS], [GTK_CONFIG])
1345                 else
1346                         AX_APPEND_FLAG([-DGTK_DISABLE_DEPRECATED], [GTK_CONFIG])
1347                 fi
1348                 AX_APPEND_FLAG([-DGTK_DISABLE_SINGLE_INCLUDES], [GTK_CONFIG])
1349                 if test ! \( $gtk_major_version -eq 2 -a $gtk_minor_version -lt 20 \) ; then
1350                         # Enable GSEAL when building with GTK > 2.20
1351                         # (Versions prior to 2.22 lacked some necessary accessors.)
1352                         AX_APPEND_FLAG([-DGSEAL_ENABLE], [GTK_CONFIG])
1353                 fi
1354
1355                 GTK_CFLAGS="$GTK_CONFIG $GTK_CFLAGS"
1356         fi
1357 fi
1358
1359 AC_SUBST(GTK_CFLAGS)
1360 AC_SUBST(GTK_LIBS)
1361 AC_SUBST(GUI_CONFIGURE_FLAGS)
1362
1363 # Check for GTK GUI support for GResource pixbufs
1364 have_gresource_pixbuf=no
1365 if test "x$have_gtk" = "xyes"; then
1366         AC_MSG_CHECKING(whether GDK-Pixbuf can load data using GResource)
1367         PKG_CHECK_EXISTS([gio-2.0 >= 2.32 gdk-pixbuf-2.0 >= 2.26],
1368           [
1369            AC_MSG_RESULT(yes)
1370            AC_DEFINE(HAVE_GDK_GRESOURCE, 1, [Defined if GResource is supported])
1371            have_gresource_pixbuf=yes
1372           ],
1373           [AC_MSG_RESULT(no)])
1374 fi
1375 AM_CONDITIONAL(HAVE_GRESOURCE_PIXBUF, test "x$have_gresource_pixbuf" = "xyes")
1376
1377 if test "$have_gtk" = "yes" -a "$have_qt" = "yes" ; then
1378         # We have both GTK and Qt and thus will be building both wireshark
1379         # and wireshark-gtk.
1380
1381         wireshark_bin="wireshark\$(EXEEXT) wireshark-gtk\$(EXEEXT)"
1382         wireshark_man="wireshark.1"
1383         wireshark_SUBDIRS="ui/qt ui/gtk"
1384 elif test "$have_gtk" = "no" -a "$have_qt" = "yes" ; then
1385         # We don't have GTK+ but we have Qt.
1386
1387         wireshark_bin="wireshark\$(EXEEXT)"
1388         wireshark_man="wireshark.1"
1389         wireshark_SUBDIRS="ui/qt"
1390 elif test "$have_gtk" = "yes" -a "$have_qt" = "no" ; then
1391         # We have GTK+ but not Qt.
1392
1393         wireshark_bin="wireshark-gtk\$(EXEEXT)"
1394         wireshark_man="wireshark.1"
1395         wireshark_SUBDIRS="ui/gtk"
1396 elif test "$have_gtk" = "no" -a "$have_qt" = "no" ; then
1397         # We have neither GTK+ nor Qt.
1398         #
1399         # If they didn't explicitly say "--disable-wireshark",
1400         # fail (so that, unless they explicitly indicated that
1401         # they don't want Wireshark, we stop so they know they
1402         # won't be getting Wireshark unless they fix the GTK+/Qt
1403         # problem).
1404         #
1405         if test "x$enable_wireshark" = "xyes"; then
1406                 if test "$with_qt" != "no" -a "$with_gtk" != "no" ; then
1407                         case "$host_os" in
1408                         darwin*)
1409                                 #
1410                                 # This is probably macOS, and the
1411                                 # problem could be that this is a
1412                                 # later version of Qt that doesn't
1413                                 # install .pc files on macOS, so
1414                                 # pkg-config can't find it.
1415                                 #
1416                                 AC_MSG_ERROR([Neither Qt nor GTK+ are installed for development, or Qt is installed but doesn't work with the configure script, so Wireshark can't be compiled; try using CMake, instead])
1417                                 ;;
1418
1419                         *)
1420                                 #
1421                                 # Qt might be installed, but only
1422                                 # for use by applications, not
1423                                 # for development.
1424                                 #
1425                                 AC_MSG_ERROR([Neither Qt nor GTK+ are installed for development, so Wireshark can't be compiled])
1426                                 ;;
1427                         esac
1428                 elif test "$with_qt" != "no" -a "$with_gtk" = "no" ; then
1429                         case "$host_os" in
1430                         darwin*)
1431                                 #
1432                                 # This is probably macOS, and the
1433                                 # problem could be that this is a
1434                                 # later version of Qt that doesn't
1435                                 # install .pc files on macOS, so
1436                                 # pkg-config can't find it.
1437                                 #
1438                                 AC_MSG_ERROR([Qt is not installed or may not work with the configure script, and GTK+ was not requested, so Wireshark cannot be compiled; try using CMake, instead])
1439                                 ;;
1440
1441                         *)
1442                                 #
1443                                 # Qt might be installed, but only
1444                                 # for use by applications, not
1445                                 # for development.
1446                                 #
1447                                 AC_MSG_ERROR([Qt is not installed for development and GTK+ was not requested, so Wireshark can't be compiled])
1448                                 ;;
1449                         esac
1450                 elif test "$with_qt" = "no" -a "$with_gtk" != "no" ; then
1451                         AC_MSG_ERROR([Qt was not requested and GTK+ is not installed for development, so Wireshark can't be compiled])
1452                 elif test "$with_qt" = "no" -a "$with_gtk" = "no" ; then
1453                         AC_MSG_ERROR([Neither Qt nor GTK+ were requested, so Wireshark can't be compiled])
1454                 fi
1455         fi
1456         wireshark_bin=""
1457         wireshark_man=""
1458         wireshark_SUBDIRS=""
1459 fi
1460
1461 #
1462 # If we have <dlfcn.h>, check whether we have dladdr.
1463 #
1464 if test "$ac_cv_header_dlfcn_h" = "yes"
1465 then
1466         #
1467         # Use GLib compiler flags and linker flags; GLib's gmodule
1468         # stuff uses the dl APIs if available, so it might know
1469         # what flags are needed.
1470         #
1471         ac_save_CFLAGS="$CFLAGS"
1472         ac_save_LIBS="$LIBS"
1473         CFLAGS="$WS_CFLAGS $GLIB_CFLAGS $CFLAGS"
1474         LIBS="$LIBS $GLIB_LIBS"
1475         AC_CHECK_FUNCS(dladdr)
1476         if test x$ac_cv_func_dladdr = xno
1477         then
1478                 #
1479                 # OK, try it with -ldl, in case you need that to get
1480                 # dladdr().  For some reason, on Linux, that's not
1481                 # part of the GLib flags; perhaps GLib itself is
1482                 # linked with libdl, so that you can link with
1483                 # Glib and it'll pull libdl in itself.
1484                 #
1485                 LIBS="$LIBS -ldl"
1486                 AC_CHECK_FUNCS(dladdr)
1487         fi
1488         CFLAGS="$ac_save_CFLAGS"
1489         LIBS="$ac_save_LIBS"
1490 fi
1491
1492 AC_SUBST(wireshark_bin)
1493 AC_SUBST(wireshark_man)
1494 AC_SUBST(wireshark_SUBDIRS)
1495 AM_CONDITIONAL(HAVE_Qt, test "$have_qt" = "yes")
1496 AM_CONDITIONAL(HAVE_QT_VERSION_4, [test $qt_version -eq 4])
1497 AM_CONDITIONAL(HAVE_GTK, test "$have_gtk" = "yes")
1498
1499 # Enable/disable tshark
1500 AC_ARG_ENABLE(tshark,
1501   AC_HELP_STRING( [--enable-tshark],
1502                   [build tshark @<:@default=yes@:>@]),
1503     tshark=$enableval,enable_tshark=yes)
1504
1505 if test "x$enable_tshark" = "xyes" ; then
1506         tshark_bin="tshark\$(EXEEXT)"
1507         tshark_man="tshark.1"
1508         wiresharkfilter_man="wireshark-filter.4"
1509 else
1510         tshark_bin=""
1511         tshark_man=""
1512 fi
1513 AC_SUBST(tshark_bin)
1514 AC_SUBST(tshark_man)
1515
1516 # Enable/disable editcap
1517
1518 AC_ARG_ENABLE(editcap,
1519   AC_HELP_STRING( [--enable-editcap],
1520                   [build editcap @<:@default=yes@:>@]),
1521     enable_editcap=$enableval,enable_editcap=yes)
1522
1523 if test "x$enable_editcap" = "xyes" ; then
1524         editcap_bin="editcap\$(EXEEXT)"
1525         editcap_man="editcap.1"
1526 else
1527         editcap_bin=""
1528         editcap_man=""
1529 fi
1530 AC_SUBST(editcap_bin)
1531 AC_SUBST(editcap_man)
1532
1533
1534 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
1535 # or not)
1536
1537 # Enable/disable capinfos
1538
1539 AC_ARG_ENABLE(capinfos,
1540   AC_HELP_STRING( [--enable-capinfos],
1541                   [build capinfos @<:@default=yes@:>@]),
1542     enable_capinfos=$enableval,enable_capinfos=yes)
1543
1544 if test "x$enable_capinfos" = "xyes" ; then
1545         capinfos_bin="capinfos\$(EXEEXT)"
1546         capinfos_man="capinfos.1"
1547 else
1548         capinfos_bin=""
1549         capinfos_man=""
1550 fi
1551 AC_SUBST(capinfos_bin)
1552 AC_SUBST(capinfos_man)
1553
1554 # Enable/disable captype
1555
1556 AC_ARG_ENABLE(captype,
1557   AC_HELP_STRING( [--enable-captype],
1558                   [build captype @<:@default=yes@:>@]),
1559     enable_captype=$enableval,enable_captype=yes)
1560
1561 if test "x$enable_captype" = "xyes" ; then
1562         captype_bin="captype\$(EXEEXT)"
1563         captype_man="captype.1"
1564 else
1565         captype_bin=""
1566         captype_man=""
1567 fi
1568 AC_SUBST(captype_bin)
1569 AC_SUBST(captype_man)
1570
1571 # Enable/disable mergecap
1572
1573 AC_ARG_ENABLE(mergecap,
1574   AC_HELP_STRING( [--enable-mergecap],
1575                   [build mergecap @<:@default=yes@:>@]),
1576     enable_mergecap=$enableval,enable_mergecap=yes)
1577
1578 if test "x$enable_mergecap" = "xyes" ; then
1579         mergecap_bin="mergecap\$(EXEEXT)"
1580         mergecap_man="mergecap.1"
1581 else
1582         mergecap_bin=""
1583         mergecap_man=""
1584 fi
1585 AC_SUBST(mergecap_bin)
1586 AC_SUBST(mergecap_man)
1587
1588 # Enable/disable reordercap
1589
1590 AC_ARG_ENABLE(reordercap,
1591   AC_HELP_STRING( [--enable-reordercap],
1592                   [build reordercap @<:@default=yes@:>@]),
1593     enable_reordercap=$enableval,enable_reordercap=yes)
1594
1595 if test "x$enable_reordercap" = "xyes" ; then
1596         reordercap_bin="reordercap\$(EXEEXT)"
1597         reordercap_man="reordercap.1"
1598 else
1599         reordercap_bin=""
1600         reordercap_man=""
1601 fi
1602 AC_SUBST(reordercap_bin)
1603 AC_SUBST(reordercap_man)
1604
1605 # Enable/disable text2pcap
1606
1607 AC_ARG_ENABLE(text2pcap,
1608   AC_HELP_STRING( [--enable-text2pcap],
1609                   [build text2pcap @<:@default=yes@:>@]),
1610     text2pcap=$enableval,enable_text2pcap=yes)
1611
1612 if test "x$enable_text2pcap" = "xyes" ; then
1613         text2pcap_bin="text2pcap\$(EXEEXT)"
1614         text2pcap_man="text2pcap.1"
1615 else
1616         text2pcap_bin=""
1617         text2pcap_man=""
1618 fi
1619 AC_SUBST(text2pcap_bin)
1620 AC_SUBST(text2pcap_man)
1621
1622 # Enable/disable dftest
1623
1624 AC_ARG_ENABLE(dftest,
1625   AC_HELP_STRING( [--enable-dftest],
1626                   [build dftest @<:@default=yes@:>@]),
1627     enable_dftest=$enableval,enable_dftest=yes)
1628
1629 if test "x$enable_dftest" = "xyes" ; then
1630         dftest_bin="dftest\$(EXEEXT)"
1631         dftest_man="dftest.1"
1632 else
1633         dftest_bin=""
1634         dftest_man=""
1635 fi
1636 AC_SUBST(dftest_bin)
1637 AC_SUBST(dftest_man)
1638
1639 # Enable/disable randpkt
1640
1641 AC_ARG_ENABLE(randpkt,
1642   AC_HELP_STRING( [--enable-randpkt],
1643                   [build randpkt @<:@default=yes@:>@]),
1644     enable_randpkt=$enableval,enable_randpkt=yes)
1645
1646 if test "x$enable_randpkt" = "xyes" ; then
1647         randpkt_bin="randpkt\$(EXEEXT)"
1648         randpkt_man="randpkt.1"
1649 else
1650         randpkt_bin=""
1651         randpkt_man=""
1652 fi
1653 AC_SUBST(randpkt_bin)
1654 AC_SUBST(randpkt_man)
1655
1656 AC_SUBST(wiresharkfilter_man)
1657
1658 dnl pcap check
1659 AC_MSG_CHECKING(whether to use libpcap for packet capture)
1660
1661 AC_ARG_WITH(pcap,
1662   AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
1663                   [use libpcap for packet capturing @<:@default=yes@:>@]),
1664 [
1665         if test $withval = no
1666         then
1667                 want_pcap=no
1668         elif test $withval = yes
1669         then
1670                 want_pcap=yes
1671         else
1672                 want_pcap=yes
1673                 pcap_dir=$withval
1674         fi
1675 ],[
1676         want_pcap=yes
1677         pcap_dir=
1678 ])
1679 if test "x$want_pcap" = "xno" ; then
1680         AC_MSG_RESULT(no)
1681 else
1682         AC_MSG_RESULT(yes)
1683         AC_WIRESHARK_PCAP_CHECK
1684 fi
1685
1686 dnl dumpcap check
1687 AC_MSG_CHECKING(whether to build dumpcap)
1688
1689 AC_ARG_ENABLE(dumpcap,
1690   AC_HELP_STRING( [--enable-dumpcap],
1691                   [build dumpcap @<:@default=yes@:>@]),
1692     enable_dumpcap=$enableval,enable_dumpcap=yes)
1693
1694 if test "x$enable_dumpcap" = "xyes" ; then
1695         if test "x$want_pcap" = "xno" ; then
1696                 enable_dumpcap=no
1697                 AC_MSG_RESULT(pcap not installed for development - disabling dumpcap)
1698         else
1699                 AC_MSG_RESULT(yes)
1700         fi
1701 else
1702         AC_MSG_RESULT(no)
1703 fi
1704
1705 if test "x$enable_dumpcap" = "xyes" ; then
1706         dumpcap_bin="dumpcap\$(EXEEXT)"
1707         dumpcap_man="dumpcap.1"
1708 else
1709         dumpcap_bin=""
1710         dumpcap_man=""
1711 fi
1712 AC_SUBST(dumpcap_bin)
1713 AC_SUBST(dumpcap_man)
1714
1715 # Enable/disable rawshark
1716
1717 dnl rawshark check
1718 AC_MSG_CHECKING(whether to build rawshark)
1719
1720 AC_ARG_ENABLE(rawshark,
1721   AC_HELP_STRING( [--enable-rawshark],
1722                   [build rawshark @<:@default=yes@:>@]),
1723     rawshark=$enableval,enable_rawshark=yes)
1724
1725 if test "x$enable_rawshark" = "xyes" ; then
1726         if test "x$want_pcap" = "xno" ; then
1727                 enable_rawshark=no
1728                 AC_MSG_RESULT(pcap not installed for development - disabling rawshark)
1729         else
1730                 AC_MSG_RESULT(yes)
1731         fi
1732 else
1733         AC_MSG_RESULT(no)
1734 fi
1735
1736 if test "x$enable_rawshark" = "xyes" ; then
1737         rawshark_bin="rawshark\$(EXEEXT)"
1738         rawshark_man="rawshark.1"
1739 else
1740         rawshark_bin=""
1741         rawshark_man=""
1742 fi
1743 AC_SUBST(rawshark_bin)
1744 AC_SUBST(rawshark_man)
1745
1746 # Enable/disable sharkd
1747 AC_ARG_ENABLE(sharkd,
1748   AC_HELP_STRING( [--enable-sharkd],
1749                   [build sharkd @<:@default=yes@:>@]),
1750     sharkd=$enableval,enable_sharkd=yes)
1751
1752 if test "x$enable_sharkd" = "xyes" ; then
1753         sharkd_bin="sharkd\$(EXEEXT)"
1754 else
1755         sharkd_bin=""
1756 fi
1757 AC_SUBST(sharkd_bin)
1758
1759 # Enable/disable tfshark
1760 AC_ARG_ENABLE(tfshark,
1761   AC_HELP_STRING( [--enable-tfshark],
1762                   [build tfshark (Experimental) @<:@default=no@:>@]),
1763     tfshark=$enableval,enable_tfshark=no)
1764
1765 if test "x$enable_tfshark" = "xyes" ; then
1766         tfshark_bin="tfshark\$(EXEEXT)"
1767         tfshark_man="tfshark.1"
1768         wiresharkfilter_man="wireshark-filter.4"
1769 else
1770         tfshark_bin=""
1771         tfshark_man=""
1772 fi
1773 AC_SUBST(tfshark_bin)
1774 AC_SUBST(tfshark_man)
1775
1776 # Enable/disable fuzzshark
1777 AC_ARG_ENABLE(fuzzshark,
1778   AC_HELP_STRING( [--enable-fuzzshark],
1779                   [build fuzzshark @<:@default=yes@:>@]),
1780     fuzzshark=$enableval,enable_fuzzshark=yes)
1781
1782 if test "x$enable_fuzzshark" = "xyes" ; then
1783         fuzzshark_bin="fuzzshark\$(EXEEXT)"
1784 else
1785         fuzzshark_bin=""
1786 fi
1787 AC_SUBST(fuzzshark_bin)
1788
1789
1790 dnl Use pcapng by default
1791 AC_ARG_ENABLE(pcap-ng-default,
1792   AC_HELP_STRING( [--enable-pcap-ng-default],
1793                   [use the pcapng file format by default instead of pcap @<:@default=yes@:>@]),
1794     enable_pcap_ng_default=$enableval,enable_pcap_ng_default=yes)
1795 if test x$enable_pcap_ng_default = xyes; then
1796         AC_DEFINE(PCAP_NG_DEFAULT, 1, [Support for pcapng])
1797 fi
1798
1799 dnl zlib check
1800 AC_MSG_CHECKING(whether to use zlib for gzip compression and decompression)
1801
1802 AC_ARG_WITH(zlib,
1803   AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
1804                  [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
1805 [
1806         if test "x$withval" = "xno"
1807         then
1808                 want_zlib=no
1809         elif test "x$withval" = "xyes"
1810         then
1811                 want_zlib=yes
1812         else
1813                 want_zlib=yes
1814                 zlib_dir="$withval"
1815         fi
1816 ],[
1817         #
1818         # Use zlib if it's present, otherwise don't.
1819         #
1820         want_zlib=ifavailable
1821         zlib_dir=
1822 ])
1823 if test "x$want_zlib" = "xno" ; then
1824         AC_MSG_RESULT(no)
1825 else
1826         AC_MSG_RESULT(yes)
1827         AC_WIRESHARK_ZLIB_CHECK
1828         if test "x$want_zlib" = "xno" ; then
1829                 AC_MSG_RESULT(zlib not found - disabling gzip compression and decompression)
1830         else
1831                 if test "x$ac_cv_func_inflatePrime" = "xno" ; then
1832                         AC_MSG_RESULT(inflatePrime not found in zlib - disabling gzipped capture file support)
1833                 fi
1834         fi
1835 fi
1836
1837 dnl lz4 check
1838 LZ4_LIBS=''
1839 AC_MSG_CHECKING(whether to use lz4 compression and decompression)
1840
1841 AC_ARG_WITH(lz4,
1842   AC_HELP_STRING([--with-lz4@<:@=DIR@:>@],
1843                  [use lz4 (located in directory DIR, if supplied) for lz4 compression and decompression @<:@default=yes, if available@:>@]),
1844 [
1845         if test "x$withval" = "xno"
1846         then
1847                 want_lz4=no
1848         elif test "x$withval" = "xyes"
1849         then
1850                 want_lz4=yes
1851         else
1852                 want_lz4=yes
1853                 lz4_dir="$withval"
1854         fi
1855 ],[
1856         #
1857         # Use lz4 if it's present, otherwise don't.
1858         #
1859         want_lz4=ifavailable
1860         lz4_dir=
1861 ])
1862 have_lz4=no
1863 if test "x$want_lz4" = "xno" ; then
1864         AC_MSG_RESULT(no)
1865 else
1866         AC_MSG_RESULT(yes)
1867         AC_WIRESHARK_LZ4_CHECK
1868         if test "x$want_lz4" = "xno" ; then
1869                 AC_MSG_RESULT(lz4 not found - disabling lz4 compression and decompression)
1870         else
1871                 if test "x$ac_cv_func_LZ4_decompress_safe" = "xno" ; then
1872                         AC_MSG_RESULT(LZ4_decompress_safe not found in lz4 - disabling cql lz4 decompression)
1873                 else
1874                         have_lz4=yes
1875                 fi
1876         fi
1877 fi
1878 AC_SUBST(LZ4_LIBS)
1879
1880 dnl snappy check
1881 SNAPPY_LIBS=''
1882 AC_MSG_CHECKING(whether to use snappy compression and decompression)
1883
1884 AC_ARG_WITH(snappy,
1885   AC_HELP_STRING([--with-snappy@<:@=DIR@:>@],
1886                  [use snappy (located in directory DIR, if supplied) for snappy compression and decompression @<:@default=yes, if available@:>@]),
1887 [
1888         if test "x$withval" = "xno"
1889         then
1890                 want_snappy=no
1891         elif test "x$withval" = "xyes"
1892         then
1893                 want_snappy=yes
1894         else
1895                 want_snappy=yes
1896                 snappy_dir="$withval"
1897         fi
1898 ],[
1899         #
1900         # Use snappy if it's present, otherwise don't.
1901         #
1902         want_snappy=ifavailable
1903         snappy_dir=
1904 ])
1905 have_snappy=no
1906 if test "x$want_snappy" = "xno" ; then
1907         AC_MSG_RESULT(no)
1908 else
1909         AC_MSG_RESULT(yes)
1910         AC_WIRESHARK_SNAPPY_CHECK
1911         if test "x$want_snappy" = "xno" ; then
1912                 AC_MSG_RESULT(snappy not found - disabling snappy compression and decompression)
1913         else
1914                 if test "x$ac_cv_func_snappy_uncompress" = "xno" ; then
1915                         AC_MSG_RESULT(snappy_uncompress not found in snappy - disabling cql snappy decompression)
1916                 else
1917                         have_snappy=yes
1918                 fi
1919         fi
1920 fi
1921 AC_SUBST(SNAPPY_LIBS)
1922
1923 dnl Lua check
1924 AC_ARG_WITH(lua,
1925   AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
1926                   [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
1927 [
1928         if test $withval = no
1929         then
1930                 want_lua=no
1931         elif test $withval = yes
1932         then
1933                 want_lua=yes
1934         else
1935                 want_lua=yes
1936                 want_lua_dir=$withval
1937         fi
1938 ],[
1939         # By default use Lua if we can find it
1940         want_lua=ifavailable
1941         lua_dir=
1942 ])
1943 if test "x$want_lua" != "xno" ; then
1944         AC_WIRESHARK_LIBLUA_CHECK
1945
1946         if test "x$want_lua" = "xyes" -a "x$have_lua" = "xno"
1947         then
1948                 AC_MSG_ERROR([Lua support was requested, but is not installed for development])
1949         fi
1950 fi
1951 if test "x$have_lua" = "xyes"
1952 then
1953         AC_DEFINE(HAVE_LUA, 1, [Define to use Lua])
1954 fi
1955 AM_CONDITIONAL(HAVE_LIBLUA, test x$have_lua = xyes)
1956 AC_SUBST(LUA_LIBS)
1957 AC_SUBST(LUA_CFLAGS)
1958
1959
1960 dnl portaudio check
1961 AC_MSG_CHECKING(whether to use libportaudio for the GTK+ RTP player)
1962
1963 AC_ARG_WITH(portaudio,
1964   AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
1965                   [use libportaudio (located in directory DIR, if supplied) for the GTK+ RTP player @<:@default=yes, if available@:>@]),
1966 [
1967         if test $withval = no
1968         then
1969                 want_portaudio=no
1970         elif test $withval = yes
1971         then
1972                 want_portaudio=yes
1973         else
1974                 want_portaudio=yes
1975                 portaudio_dir=$withval
1976         fi
1977 ],[
1978         #
1979         # Use libportaudio by default
1980         #
1981         want_portaudio=ifavailable
1982         portaudio_dir=
1983 ])
1984 if test "x$want_portaudio" = "xno" ; then
1985         AC_MSG_RESULT(no)
1986 else
1987         AC_MSG_RESULT(yes)
1988         AC_WIRESHARK_LIBPORTAUDIO_CHECK
1989         if test "x$want_portaudio" = "xno" ; then
1990                 AC_MSG_RESULT(libportaudio not found - disabling support for the GTK+ RTP player)
1991         fi
1992 fi
1993 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
1994
1995
1996 dnl Check if dumpcap should be installed with filesystem capabilities
1997 AC_PATH_PROG(SETCAP, setcap)
1998 AC_ARG_ENABLE(setcap-install,
1999   AC_HELP_STRING( [--enable-setcap-install],
2000                   [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
2001     enable_setcap_install=$enableval,enable_setcap_install=no)
2002
2003 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
2004 if test "x$enable_setcap_install" = "xno" ; then
2005         AC_MSG_RESULT(no)
2006 else
2007         if test "x$SETCAP" = "x" ; then
2008                 AC_MSG_RESULT(setcap not found)
2009                 AC_MSG_ERROR([Setcap install was requested, but setcap was not found])
2010         elif test "x$enable_dumpcap" = "xno" ; then
2011                 AC_MSG_RESULT(dumpcap disabled)
2012                 AC_MSG_ERROR([Setcap install works only with dumpcap, but dumpcap is disabled])
2013         else
2014                 AC_MSG_RESULT(yes)
2015         fi
2016 fi
2017
2018 AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
2019
2020 dnl Check if dumpcap should be installed setuid
2021 AC_ARG_ENABLE(setuid-install,
2022   AC_HELP_STRING( [--enable-setuid-install],
2023                   [install dumpcap as setuid @<:@default=no@:>@]),
2024     enable_setuid_install=$enableval,enable_setuid_install=no)
2025
2026 AC_MSG_CHECKING(whether to install dumpcap setuid)
2027 if test "x$enable_setuid_install" = "xno" ; then
2028         AC_MSG_RESULT(no)
2029 else
2030         if test "x$enable_setcap_install" = "xyes" ; then
2031                 enable_setuid_install=no
2032                 AC_MSG_RESULT(setcap and setuid both selected)
2033                 AC_MSG_ERROR(You must choose one of setcap install and setuid install)
2034         elif test "x$enable_dumpcap" = "xno" ; then
2035                 AC_MSG_RESULT(dumpcap disabled)
2036                 AC_MSG_ERROR([Setuid install works only with dumpcap, but dumpcap is disabled])
2037         else
2038                 AC_MSG_RESULT(yes)
2039         fi
2040 fi
2041
2042 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
2043 AC_CHECK_FUNCS(setresuid setresgid)
2044
2045 dnl ...but our Network Operations group is named "no"!
2046 DUMPCAP_GROUP=''
2047 AC_ARG_WITH(dumpcap-group,
2048   AC_HELP_STRING( [--with-dumpcap-group=GROUP],
2049                   [restrict dumpcap to GROUP]),
2050 [
2051   if test "x$withval" = "xyes"; then
2052       AC_MSG_ERROR([No dumpcap group specified.])
2053   elif test "x$withval" != "xno"; then
2054       if test "x$enable_dumpcap" = "xno" ; then
2055           AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
2056       fi
2057       AC_MSG_RESULT($withval)
2058       DUMPCAP_GROUP="$withval"
2059   fi
2060 ])
2061 AC_SUBST(DUMPCAP_GROUP)
2062 AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
2063
2064 dnl libcap (not libpcap) check
2065 LIBCAP_LIBS=''
2066 AC_MSG_CHECKING(whether to use the libcap capabilities library)
2067
2068 AC_ARG_WITH(libcap,
2069   AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
2070                   [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
2071 [
2072 if   test "x$withval" = "xno";  then
2073         want_libcap=no
2074 elif test "x$withval" = "xyes"; then
2075         want_libcap=yes
2076 elif test -d "$withval"; then
2077         want_libcap=yes
2078         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2079 fi
2080 ])
2081 if test "x$with_libcap" = "xno" ; then
2082         AC_MSG_RESULT(no)
2083 else
2084         AC_MSG_RESULT(yes)
2085         AC_WIRESHARK_LIBCAP_CHECK
2086 fi
2087 AC_SUBST(LIBCAP_LIBS)
2088
2089 dnl Checks for header files.
2090 dnl Some of these may not be needed: http://hacks.owlfolio.org/header-survey/
2091 dnl Note, however, that, whilst this script is generally run only on UN*Xes:
2092 dnl
2093 dnl     1) we also support building on and for Windows and not all of those
2094 dnl        headers are present on Windows, so the code has to check a
2095 dnl        #define *anyway* to determine whether to include the header
2096 dnl        file
2097 dnl
2098 dnl and
2099 dnl
2100 dnl     2) this might also be run on Windows with a sufficiently UNIXy
2101 dnl        environment such as Cygwin (although Wireshark should be built
2102 dnl        natively rather than using Cygwin).
2103 dnl
2104 AC_CHECK_HEADERS(fcntl.h getopt.h grp.h inttypes.h netdb.h pwd.h unistd.h)
2105 AC_CHECK_HEADERS(sys/ioctl.h sys/param.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h)
2106 AC_CHECK_HEADERS(netinet/in.h)
2107 AC_CHECK_HEADERS(arpa/inet.h)
2108 AC_CHECK_HEADERS(ifaddrs.h)
2109
2110 #
2111 # On Linux, check for some additional headers, which we need as a
2112 # workaround for a bonding driver bug and for libpcap's current lack
2113 # of its own workaround for that bug.
2114 #
2115 case "$host_os" in
2116 linux*)
2117         AC_CHECK_HEADERS(linux/sockios.h linux/if_bonding.h,,,[#include <sys/socket.h>])
2118         ;;
2119 esac
2120
2121 dnl kerberos check
2122 AC_MSG_CHECKING(whether to use Kerberos library)
2123
2124 AC_ARG_WITH(krb5,
2125   AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
2126                   [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
2127 [
2128         if test $withval = no
2129         then
2130                 want_krb5=no
2131         elif test $withval = yes
2132         then
2133                 want_krb5=yes
2134         else
2135                 want_krb5=yes
2136                 krb5_dir=$withval
2137         fi
2138 ],[
2139         #
2140         # Use Kerberos library if available, otherwise don't.
2141         #
2142         want_krb5=ifavailable
2143         krb5_dir=
2144 ])
2145 if test "x$want_krb5" = "xno" ; then
2146         AC_MSG_RESULT(no)
2147 else
2148         AC_MSG_RESULT(yes)
2149         AC_WIRESHARK_KRB5_CHECK
2150 fi
2151
2152 dnl
2153 dnl We use GnuTLS for SSL decryption but some builds of Kerberos require
2154 dnl linking with OpenSSL. We don't want to build with it by default due to
2155 dnl annoying license incompatibilities between the OpenSSL license and the GPL,
2156 dnl so we require an explicit option to configure.
2157 dnl
2158 AC_ARG_WITH(krb5-crypto-openssl,
2159   AC_HELP_STRING( [--with-krb5-crypto-openssl],
2160                   [Allow linking with OpenSSL for Kerberos crypto backend @<:@default=no@:>@]))
2161
2162 dnl c-ares Check
2163 C_ARES_LIBS=''
2164 AC_MSG_CHECKING(whether to use the c-ares library if available)
2165
2166 AC_ARG_WITH(c-ares,
2167   AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
2168                   [use c-ares (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2169 [
2170 if   test "x$withval" = "xno";  then
2171         want_c_ares=no
2172 elif test "x$withval" = "xyes"; then
2173         want_c_ares=yes
2174 elif test -d "$withval"; then
2175         want_c_ares=yes
2176         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2177 fi
2178 ])
2179 if test "x$want_c_ares" = "xno" ; then
2180         AC_MSG_RESULT(no)
2181 else
2182         AC_MSG_RESULT(yes)
2183         AC_WIRESHARK_C_ARES_CHECK
2184 fi
2185 AC_SUBST(C_ARES_LIBS)
2186
2187 dnl MaxMind DB Check
2188 MAXMINDDB_LIBS=''
2189 AC_MSG_CHECKING(whether to use the MaxMind DB IP address mapping library if available)
2190
2191 AC_ARG_WITH(maxminddb,
2192   AC_HELP_STRING( [--with-maxminddb@<:@=DIR@:>@],
2193                   [use MaxMind DB (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2194 [
2195 if   test "x$withval" = "xno";  then
2196         want_maxminddb=no
2197 elif test "x$withval" = "xyes"; then
2198         want_maxminddb=yes
2199 elif test -d "$withval"; then
2200         want_maxminddb=yes
2201         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2202 fi
2203 ])
2204 if test "x$want_maxminddb" = "xno"; then
2205         AC_MSG_RESULT(no)
2206 else
2207         AC_MSG_RESULT(yes)
2208         AC_WIRESHARK_MAXMINDDB_CHECK
2209 fi
2210 AC_SUBST(MAXMINDDB_LIBS)
2211
2212 if test "x$have_good_maxminddb" = "xyes" ; then
2213         mmdbresolve_bin="mmdbresolve\$(EXEEXT)"
2214         mmdbresolve_man="mmdbresolve.1"
2215 else
2216         mmdbresolve_bin=""
2217         mmdbresolve_man=""
2218 fi
2219 AC_SUBST(mmdbresolve_bin)
2220 AC_SUBST(mmdbresolve_man)
2221
2222 dnl LIBSSH Check
2223 LIBSSH=''
2224 AC_MSG_CHECKING(whether to use the libssh library if available)
2225
2226 AC_ARG_WITH(libssh,
2227   AC_HELP_STRING( [--with-libssh@<:@=DIR@:>@],
2228                   [use libssh (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2229 [
2230 if   test "x$withval" = "xno";  then
2231         want_libssh=no
2232 elif test "x$withval" = "xyes"; then
2233         want_libssh=yes
2234 elif test -d "$withval"; then
2235         want_libssh=yes
2236         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2237 fi
2238 ])
2239 if test "x$want_libssh" = "xno"; then
2240         AC_MSG_RESULT(no)
2241 else
2242         AC_MSG_RESULT(yes)
2243         AC_WIRESHARK_LIBSSH_CHECK
2244 fi
2245 AC_SUBST(LIBSSH_LIBS)
2246
2247 dnl nghttp2 Check
2248 NGHTTP2_LIBS=''
2249 AC_MSG_CHECKING(whether to use the nghttp2 HPACK library if available)
2250
2251 AC_ARG_WITH(nghttp2,
2252   AC_HELP_STRING( [--with-nghttp2@<:@=DIR@:>@],
2253                   [use nghttp2 (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2254 [
2255 if   test "x$withval" = "xno";  then
2256         want_nghttp2=no
2257 elif test "x$withval" = "xyes"; then
2258         want_nghttp2=yes
2259 elif test -d "$withval"; then
2260         want_nghttp2=yes
2261         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2262 fi
2263 ])
2264 if test "x$want_nghttp2" = "xno"; then
2265         AC_MSG_RESULT(no)
2266 else
2267         AC_MSG_RESULT(yes)
2268         AC_WIRESHARK_NGHTTP2_CHECK
2269 fi
2270 AC_SUBST(NGHTTP2_LIBS)
2271
2272 dnl Checks for typedefs, structures, and compiler characteristics.
2273 # AC_C_CONST
2274
2275 # Check how we can get the time zone abbreviation
2276 AC_STRUCT_TIMEZONE
2277
2278 # We need to know whether "struct stat" has an "st_flags" member
2279 # for file_user_immutable().
2280
2281 AC_CHECK_MEMBERS([struct stat.st_flags])
2282
2283 # We need to know whether "struct stat" has an "st_birthtime" member
2284 # or an "__st_birthtime" member for the file set dialog.
2285
2286 AC_CHECK_MEMBERS([struct stat.st_birthtime])
2287 AC_CHECK_MEMBERS([struct stat.__st_birthtime])
2288
2289 # We need to know whether "struct sockaddr" has an "sa_len" member
2290 # for get_interface_list().
2291
2292 AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,
2293                  [#ifdef HAVE_SYS_TYPES_H
2294                   #include <sys/types.h>
2295                   #endif
2296                   #ifdef HAVE_SYS_SOCKET_H
2297                   #include <sys/socket.h>
2298                   #endif])
2299
2300 AC_REPLACE_FUNCS(getopt_long)
2301 if test "x$ac_cv_func_getopt_long" = xyes; then
2302   #
2303   # The OS has getopt_long(), so it might have optreset.  Do we have it?
2304   #
2305   AC_CACHE_CHECK([whether optreset is defined], ac_cv_have_optreset,
2306     AC_LINK_IFELSE([AC_LANG_SOURCE([[extern int optreset;return optreset;]])],
2307         ac_cv_have_optreset=yes, ac_cv_have_optreset=no))
2308   if test "$ac_cv_have_optreset" = yes ; then
2309     AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if you have the optreset variable])
2310   fi
2311 else
2312   #
2313   # The OS doesn't have getopt_long(), so we're using the GNU libc
2314   # version that we have in wsutil.  It doesn't have optreset, so we
2315   # don't need to check for it.
2316   #
2317   # However, it uses alloca(), so we may need to include alloca.h;
2318   # check for it.
2319   #
2320   AC_CHECK_HEADERS(alloca.h)
2321 fi
2322
2323 AC_REPLACE_FUNCS(strptime)
2324
2325 AC_CHECK_FUNCS(mkstemps)
2326 AC_CHECK_FUNCS(issetugid)
2327 AC_CHECK_FUNCS(sysconf)
2328 AC_CHECK_FUNCS(getifaddrs)
2329 AC_CHECK_FUNC(getexecname)
2330
2331 #
2332 # Check for SpeexDSP (http://www.speex.org)
2333 #
2334 AS_IF([test "x$have_qt_multimedia_lib" = xyes],
2335         [PKG_CHECK_MODULES(SPEEXDSP, speexdsp, [have_speexdsp=yes], [have_speexdsp=no])])
2336 AS_IF([test "x$have_speexdsp" = xyes],
2337         [AC_DEFINE(HAVE_SPEEXDSP, 1, [Define to 1 if you have SpeexDSP])])
2338 AM_CONDITIONAL(HAVE_SPEEXDSP, [test "x$have_speexdsp" = "xyes"])
2339
2340 # Check Bluetooth SBC codec for RTP Player
2341 # git://git.kernel.org/pub/scm/bluetooth/sbc.git
2342 AC_ARG_WITH([sbc],
2343   AC_HELP_STRING( [--with-sbc=@<:@yes/no@:>@],
2344                   [use SBC codec to play Bluetooth A2DP stream @<:@default=yes, if available@:>@]),
2345   with_sbc="$withval"; want_sbc="yes", with_sbc="yes")
2346
2347 PKG_CHECK_MODULES(SBC, sbc >= 1.0, [have_sbc=yes], [have_sbc=no])
2348 if test "x$with_sbc" != "xno"; then
2349     if (test "${have_sbc}" = "yes"); then
2350         AC_DEFINE(HAVE_SBC, 1, [Define to support playing SBC by standalone BlueZ SBC library])
2351     elif test "x$want_sbc" = "xyes"; then
2352         # Error out if the user explicitly requested the sbc library
2353         AC_MSG_ERROR([SBC codec library was requested, but is not installed for development])
2354     fi
2355 else
2356     have_sbc=no
2357 fi
2358 AM_CONDITIONAL(HAVE_SBC, test "x$have_sbc" = "xyes")
2359
2360 #`
2361 # Check SpanDSP library for RTP Player
2362 # http://www.soft-switch.org/
2363 AC_ARG_WITH([spandsp],
2364   AC_HELP_STRING( [--with-spandsp=@<:@yes/no@:>@],
2365                  [use SpanDSP to play G.722/G.726 codecs @<:@default=yes, if available@:>@]),
2366   with_spandsp="$withval"; want_spandsp="yes", with_spandsp="yes")
2367
2368 PKG_CHECK_MODULES(SPANDSP, spandsp, [have_spandsp=yes], [have_spandsp=no])
2369 if test "x$with_spandsp" != "xno"; then
2370     if (test "${have_spandsp}" = "yes"); then
2371         AC_DEFINE(HAVE_SPANDSP, 1, [Define if you have the SpanDSP library])
2372     elif test "x$want_spandsp" = "xyes"; then
2373         # Error out if the user explicitly requested the SpanDSP library
2374         AC_MSG_ERROR([SpanDSP library was requested, but is not installed for development])
2375     fi
2376 else
2377     have_spandsp=no
2378 fi
2379 AM_CONDITIONAL(HAVE_SPANDSP, test "x$have_spandsp" = "xyes")
2380
2381 #`
2382 # Check bcg729 library for RTP Player
2383 # https://www.linphone.org/technical-corner/bcg729/overview
2384 dnl bcg729 Check
2385 BCG729_LIBS=''
2386 AC_MSG_CHECKING(whether to use the bcg729 library if available)
2387
2388 AC_ARG_WITH([bcg729],
2389   AC_HELP_STRING( [--with-bcg729=@<:@=DIR@:>@],
2390                  [use bcg729 to play G.729 codec(located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
2391 [
2392 if   test "x$withval" = "xno";  then
2393         want_bcg729=no
2394 elif test "x$withval" = "xyes"; then
2395         want_bcg729=yes
2396 elif test -d "$withval"; then
2397         want_bcg729=yes
2398         AC_WIRESHARK_ADD_DASH_L(WS_LDFLAGS, ${withval}/lib)
2399 fi
2400 ])
2401 if test "x$want_bcg729" = "xno"; then
2402         AC_MSG_RESULT(no)
2403 else
2404         AC_MSG_RESULT(yes)
2405         AC_WIRESHARK_BCG729_CHECK
2406 fi
2407 AC_SUBST(BCG729_LIBS)
2408 AM_CONDITIONAL(HAVE_BCG729, test "x$have_good_bcg729" = "xyes")
2409
2410 #`
2411 # Libxml2 check
2412 AC_ARG_WITH(libxml2,
2413   AC_HELP_STRING([--with-libxml2=@<:@yes/no@:>@],
2414                  [Libxml2 is a XML C parser, which can be used for handling XML configuration in dissectors @<:@default=yes, if available@:>@]),
2415   with_libxml2="$withval"; want_libxml2="yes", with_libxml2="yes")
2416
2417 PKG_CHECK_MODULES(LIBXML2, libxml-2.0, [have_libxml2=yes], [have_libxml2=no])
2418 if test "x$with_libxml2" != "xno"; then
2419     if (test "${have_libxml2}" = "yes"); then
2420         AC_DEFINE(HAVE_LIBXML2, 1, [Define if you have libxml2])
2421     elif test "x$want_libxml2" = "xyes"; then
2422         # Error out if the user explicitly requested libxml2
2423         AC_MSG_ERROR([Libxml2 was requested, but is not installed for development])
2424     fi
2425 else
2426     have_libxml2=no
2427 fi
2428 AM_CONDITIONAL(HAVE_LIBXML2, test "x$have_libxml2" = "xyes")
2429
2430 #
2431 # Libsmi check
2432 #
2433 AC_ARG_WITH(libsmi,
2434   AC_HELP_STRING([--with-libsmi=@<:@yes/no@:>@],
2435                  [use libsmi MIB/PIB library @<:@default=yes, if available@:>@]),
2436                  [], [with_libsmi="if_available"])
2437
2438 have_libsmi=no
2439 if test "x$with_libsmi" != "xno"; then
2440         PKG_CHECK_MODULES(LIBSMI, libsmi,
2441                 [have_libsmi=yes
2442                  AC_DEFINE(HAVE_LIBSMI, 1, [Define if you have libsmi])
2443                 ],
2444                 [if test "x$with_libsmi" = "xyes"; then
2445                         # Error out if the user explicitly requested libsmi
2446                         AC_MSG_ERROR([Libsmi was requested, but is not installed for development])
2447                  fi
2448                 ]
2449         )
2450 fi
2451
2452 dnl
2453 dnl check whether plugins should be enabled
2454 dnl
2455 AC_ARG_ENABLE(plugins,
2456   AC_HELP_STRING( [--enable-plugins],
2457                   [support plugins (if available on your platform) @<:@default=yes@:>@]),
2458                   [have_plugins=$enableval], [have_plugins=yes])
2459
2460 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
2461 if test x$have_plugins = xyes
2462 then
2463   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
2464 fi
2465 dnl we don't wish to expand ${libdir} yet
2466 plugindir="\${libdir}/wireshark/plugins/$VERSION_RELEASE"
2467 AC_SUBST(plugindir)
2468
2469 #
2470 # The plugin dissectors reside in ./plugins/PROTO/
2471 #
2472 PLUGIN_LIBS=""
2473 AC_SUBST(PLUGIN_LIBS)
2474
2475 dnl
2476 dnl check whether extcap programs should be enabled and, if they should be,
2477 dnl check for extcap directory - stolen from Amanda's configure.ac
2478 dnl
2479 dnl we don't wish to expand ${libdir} yet
2480 extcapdir="\${libdir}/wireshark/extcap"
2481 extcap_man="extcap.4"
2482
2483 AC_SUBST(extcap_man)
2484 AC_SUBST(extcapdir)
2485
2486 dnl androiddump check
2487 AC_MSG_CHECKING(whether to build androiddump)
2488
2489 AC_ARG_ENABLE(androiddump,
2490   AC_HELP_STRING( [--enable-androiddump],
2491                   [build androiddump @<:@default=yes@:>@]),
2492     androiddump=$enableval,enable_androiddump=yes)
2493
2494 if test "x$enable_androiddump" = "xyes" ; then
2495         AC_MSG_RESULT(yes)
2496 else
2497         AC_MSG_RESULT(no)
2498 fi
2499
2500 AC_ARG_ENABLE(androiddump_use_libpcap,
2501   AC_HELP_STRING( [--enable-androiddump-use-libpcap],
2502                   [build androiddump using libpcap @<:@default=no@:>@]),
2503     androiddump_use_libpcap=$enableval,enable_androiddump_use_libpcap=no)
2504
2505 if test "x$enable_androiddump" = "xyes" -a "x$enable_androiddump_use_libpcap" = "xyes" ; then
2506         AC_DEFINE(ANDROIDDUMP_USE_LIBPCAP, 1, [Androiddump will use Libpcap])
2507 fi
2508
2509 if test "x$enable_androiddump" = "xyes" ; then
2510         androiddump_bin="androiddump\$(EXEEXT)"
2511         androiddump_man="androiddump.1"
2512 else
2513         androiddump_bin=""
2514         androiddump_man=""
2515 fi
2516 AC_SUBST(androiddump_bin)
2517 AC_SUBST(androiddump_man)
2518
2519 dnl sshdump check
2520 AC_MSG_CHECKING(whether to build sshdump)
2521
2522 AC_ARG_ENABLE(sshdump,
2523         AC_HELP_STRING( [--enable-sshdump],
2524                 [build sshdump @<:@default=yes@:>@]),
2525         [],[enable_sshdump=yes])
2526
2527 if test "x$have_libssh_pointsix" != xyes; then
2528         AC_MSG_RESULT([no, libssh >= 0.6.0 not installed for development])
2529         enable_sshdump=no
2530 elif test "x$enable_sshdump" = "xyes" ; then
2531         AC_MSG_RESULT(yes)
2532 else
2533         AC_MSG_RESULT(no)
2534 fi
2535
2536 if test "x$enable_sshdump" = "xyes" ; then
2537         sshdump_bin="sshdump\$(EXEEXT)"
2538         sshdump_man="sshdump.1"
2539 else
2540         sshdump_bin=""
2541         sshdump_man=""
2542 fi
2543 AC_SUBST(sshdump_bin)
2544 AC_SUBST(sshdump_man)
2545
2546 dnl ciscodump check
2547 AC_MSG_CHECKING(whether to build ciscodump)
2548
2549 AC_ARG_ENABLE(ciscodump,
2550         AC_HELP_STRING( [--enable-ciscodump],
2551                 [build ciscodump @<:@default=yes@:>@]),
2552         [],[enable_ciscodump=yes])
2553
2554 if test "x$have_libssh_pointsix" != xyes; then
2555         AC_MSG_RESULT([no, libssh >= 0.6.0 not installed for development])
2556         enable_ciscodump=no
2557 elif test "x$enable_ciscodump" = "xyes" ; then
2558         AC_MSG_RESULT(yes)
2559 else
2560         AC_MSG_RESULT(no)
2561 fi
2562
2563 if test "x$enable_ciscodump" = "xyes" ; then
2564         ciscodump_bin="ciscodump\$(EXEEXT)"
2565         ciscodump_man="ciscodump.1"
2566 else
2567         ciscodump_bin=""
2568         ciscodump_man=""
2569 fi
2570 AC_SUBST(ciscodump_bin)
2571 AC_SUBST(ciscodump_man)
2572
2573 dnl randpktdump check
2574 AC_MSG_CHECKING(whether to build randpktdump)
2575
2576 AC_ARG_ENABLE(randpktdump,
2577         AC_HELP_STRING( [--enable-randpktdump],
2578                 [build randpktdump @<:@default=yes@:>@]),
2579         randpktdump=$enableval,enable_randpktdump=yes)
2580
2581 if test "x$enable_randpktdump" = "xyes" ; then
2582         AC_MSG_RESULT(yes)
2583 else
2584         AC_MSG_RESULT(no)
2585 fi
2586
2587 if test "x$enable_randpktdump" = "xyes" ; then
2588         randpktdump_bin="randpktdump\$(EXEEXT)"
2589         randpktdump_man="randpktdump.1"
2590 else
2591         randpktdump_bin=""
2592         randpktdump_man=""
2593 fi
2594 AC_SUBST(randpktdump_bin)
2595 AC_SUBST(randpktdump_man)
2596
2597 dnl udpdump check
2598 AC_MSG_CHECKING(whether to build udpdump)
2599
2600 AC_ARG_ENABLE(udpdump,
2601         AC_HELP_STRING( [--enable-udpdump],
2602                 [build udpdump @<:@default=yes@:>@]),
2603         [],[enable_udpdump=yes])
2604
2605 if test "x$enable_udpdump" = "xyes" ; then
2606         AC_MSG_RESULT(yes)
2607 else
2608         AC_MSG_RESULT(no)
2609 fi
2610
2611 if test "x$enable_udpdump" = "xyes" ; then
2612         udpdump_bin="udpdump\$(EXEEXT)"
2613         udpdump_man="udpdump.1"
2614 else
2615         udpdump_bin=""
2616         udpdump_man=""
2617 fi
2618 AC_SUBST(udpdump_bin)
2619 AC_SUBST(udpdump_man)
2620
2621 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
2622 if test x$enable_static = xyes
2623 then
2624   AC_DEFINE(ENABLE_STATIC, 1, [Link Wireshark libraries statically])
2625 fi
2626
2627 # Gather which GUI we're building for rpmbuild
2628 if test "x$have_gtk" = "xyes"; then
2629         if test "x$gtk_major_version" = "x3"; then
2630                 RPMBUILD_WITH_ARGS="--with gtk3 --without gtk2"
2631         else
2632                 RPMBUILD_WITH_ARGS="--without gtk3 --with gtk2"
2633         fi
2634 else
2635         RPMBUILD_WITH_ARGS="--without gtk2 --without gtk3"
2636 fi
2637 if test "x$have_qt" = "xyes" ; then
2638         if test "$qt_version" -eq "5"; then
2639                 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt5"
2640         else
2641                 RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with qt"
2642         fi
2643 else
2644         RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without qt --without qt5"
2645 fi
2646 if test "x$have_lua" = "xyes" ; then
2647         RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --with lua"
2648 else
2649         RPMBUILD_WITH_ARGS="$RPMBUILD_WITH_ARGS --without lua"
2650 fi
2651 AC_SUBST(RPMBUILD_WITH_ARGS)
2652 AC_SUBST(RPM_VERSION, version_major.version_minor.version_micro)
2653
2654 AC_SUBST(WS_CPPFLAGS)
2655 AC_SUBST(WS_CFLAGS)
2656 AC_SUBST(WS_CXXFLAGS)
2657 AC_SUBST(WS_LDFLAGS)
2658
2659 AC_SUBST(WS_CFLAGS_FOR_BUILD)
2660
2661 AH_BOTTOM([#include <ws_diag_control.h>])
2662
2663 dnl Save the cacheable configure results to config.cache before recursing
2664 AC_CACHE_SAVE
2665
2666 m4_sinclude(plugins/Custom.m4) dnl
2667 m4_ifndef(_CUSTOM_PLUGIN_CONFIG_FILES_, m4_define(_CUSTOM_PLUGIN_CONFIG_FILES_)) dnl
2668
2669 sinclude(epan/dissectors/asn1/Custom.m4) dnl
2670 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
2671
2672 AC_CONFIG_HEADERS([config.h])
2673
2674 AC_CONFIG_FILES(
2675   Makefile
2676   doxygen.cfg
2677   epan/dissectors/asn1/Makefile
2678   wireshark.pc
2679   _CUSTOM_ASN1_AC_OUTPUT_
2680   epan/dissectors/asn1/acp133/Makefile
2681   epan/dissectors/asn1/acse/Makefile
2682   epan/dissectors/asn1/ansi_map/Makefile
2683   epan/dissectors/asn1/ansi_tcap/Makefile
2684   epan/dissectors/asn1/atn-cm/Makefile
2685   epan/dissectors/asn1/atn-cpdlc/Makefile
2686   epan/dissectors/asn1/atn-ulcs/Makefile
2687   epan/dissectors/asn1/c1222/Makefile
2688   epan/dissectors/asn1/camel/Makefile
2689   epan/dissectors/asn1/cdt/Makefile
2690   epan/dissectors/asn1/charging_ase/Makefile
2691   epan/dissectors/asn1/cmip/Makefile
2692   epan/dissectors/asn1/cmp/Makefile
2693   epan/dissectors/asn1/crmf/Makefile
2694   epan/dissectors/asn1/cms/Makefile
2695   epan/dissectors/asn1/credssp/Makefile
2696   epan/dissectors/asn1/dap/Makefile
2697   epan/dissectors/asn1/disp/Makefile
2698   epan/dissectors/asn1/dop/Makefile
2699   epan/dissectors/asn1/dsp/Makefile
2700   epan/dissectors/asn1/ess/Makefile
2701   epan/dissectors/asn1/f1ap/Makefile
2702   epan/dissectors/asn1/ftam/Makefile
2703   epan/dissectors/asn1/goose/Makefile
2704   epan/dissectors/asn1/gprscdr/Makefile
2705   epan/dissectors/asn1/gsm_map/Makefile
2706   epan/dissectors/asn1/h225/Makefile
2707   epan/dissectors/asn1/h235/Makefile
2708   epan/dissectors/asn1/h245/Makefile
2709   epan/dissectors/asn1/h248/Makefile
2710   epan/dissectors/asn1/h282/Makefile
2711   epan/dissectors/asn1/h283/Makefile
2712   epan/dissectors/asn1/h323/Makefile
2713   epan/dissectors/asn1/h450/Makefile
2714   epan/dissectors/asn1/h450-ros/Makefile
2715   epan/dissectors/asn1/h460/Makefile
2716   epan/dissectors/asn1/h501/Makefile
2717   epan/dissectors/asn1/HI2Operations/Makefile
2718   epan/dissectors/asn1/hnbap/Makefile
2719   epan/dissectors/asn1/idmp/Makefile
2720   epan/dissectors/asn1/ilp/Makefile
2721   epan/dissectors/asn1/inap/Makefile
2722   epan/dissectors/asn1/isdn-sup/Makefile
2723   epan/dissectors/asn1/kerberos/Makefile
2724   epan/dissectors/asn1/lcsap/Makefile
2725   epan/dissectors/asn1/ldap/Makefile
2726   epan/dissectors/asn1/logotypecertextn/Makefile
2727   epan/dissectors/asn1/lpp/Makefile
2728   epan/dissectors/asn1/lppa/Makefile
2729   epan/dissectors/asn1/lppe/Makefile
2730   epan/dissectors/asn1/lte-rrc/Makefile
2731   epan/dissectors/asn1/m2ap/Makefile
2732   epan/dissectors/asn1/m3ap/Makefile
2733   epan/dissectors/asn1/mms/Makefile
2734   epan/dissectors/asn1/mpeg-audio/Makefile
2735   epan/dissectors/asn1/mpeg-pes/Makefile
2736   epan/dissectors/asn1/mudurl/Makefile
2737   epan/dissectors/asn1/nbap/Makefile
2738   epan/dissectors/asn1/nr-rrc/Makefile
2739   epan/dissectors/asn1/ns_cert_exts/Makefile
2740   epan/dissectors/asn1/novell_pkis/Makefile
2741   epan/dissectors/asn1/ocsp/Makefile
2742   epan/dissectors/asn1/p1/Makefile
2743   epan/dissectors/asn1/p22/Makefile
2744   epan/dissectors/asn1/p7/Makefile
2745   epan/dissectors/asn1/p772/Makefile
2746   epan/dissectors/asn1/pcap/Makefile
2747   epan/dissectors/asn1/pkcs1/Makefile
2748   epan/dissectors/asn1/pkcs12/Makefile
2749   epan/dissectors/asn1/pkinit/Makefile
2750   epan/dissectors/asn1/pkixac/Makefile
2751   epan/dissectors/asn1/pkix1explicit/Makefile
2752   epan/dissectors/asn1/pkix1implicit/Makefile
2753   epan/dissectors/asn1/pkixproxy/Makefile
2754   epan/dissectors/asn1/pkixqualified/Makefile
2755   epan/dissectors/asn1/pkixtsp/Makefile
2756   epan/dissectors/asn1/pres/Makefile
2757   epan/dissectors/asn1/q932/Makefile
2758   epan/dissectors/asn1/q932-ros/Makefile
2759   epan/dissectors/asn1/qsig/Makefile
2760   epan/dissectors/asn1/ranap/Makefile
2761   epan/dissectors/asn1/rnsap/Makefile
2762   epan/dissectors/asn1/ros/Makefile
2763   epan/dissectors/asn1/rrc/Makefile
2764   epan/dissectors/asn1/rrlp/Makefile
2765   epan/dissectors/asn1/rtse/Makefile
2766   epan/dissectors/asn1/rua/Makefile
2767   epan/dissectors/asn1/s1ap/Makefile
2768   epan/dissectors/asn1/sabp/Makefile
2769   epan/dissectors/asn1/sbc-ap/Makefile
2770   epan/dissectors/asn1/smrse/Makefile
2771   epan/dissectors/asn1/snmp/Makefile
2772   epan/dissectors/asn1/spnego/Makefile
2773   epan/dissectors/asn1/sv/Makefile
2774   epan/dissectors/asn1/t124/Makefile
2775   epan/dissectors/asn1/t125/Makefile
2776   epan/dissectors/asn1/t38/Makefile
2777   epan/dissectors/asn1/tcap/Makefile
2778   epan/dissectors/asn1/tetra/Makefile
2779   epan/dissectors/asn1/ulp/Makefile
2780   epan/dissectors/asn1/wlancertextn/Makefile
2781   epan/dissectors/asn1/x2ap/Makefile
2782   epan/dissectors/asn1/x509af/Makefile
2783   epan/dissectors/asn1/x509ce/Makefile
2784   epan/dissectors/asn1/x509if/Makefile
2785   epan/dissectors/asn1/x509sat/Makefile
2786   capchild/Makefile
2787   capchild/doxygen.cfg
2788   caputils/Makefile
2789   caputils/doxygen.cfg
2790   doc/Makefile
2791   docbook/Makefile
2792   epan/Makefile
2793   epan/crypt/Makefile
2794   epan/doxygen.cfg
2795   epan/dfilter/Makefile
2796   epan/dissectors/Makefile
2797   epan/dissectors/dcerpc/Makefile
2798   epan/ftypes/Makefile
2799   epan/wmem/Makefile
2800   epan/wslua/Makefile
2801   extcap/Makefile
2802   codecs/Makefile
2803   ui/Makefile
2804   ui/doxygen.cfg
2805   ui/gtk/Makefile
2806   ui/gtk/doxygen.cfg
2807   ui/cli/Makefile
2808   ui/qt/Makefile
2809   ui/qt/doxygen.cfg
2810   help/Makefile
2811   packaging/Makefile
2812   packaging/macosx/Info.plist
2813   packaging/macosx/Makefile
2814   packaging/macosx/Wireshark_package.pmdoc/index.xml
2815   packaging/nsis/Makefile
2816   packaging/rpm/Makefile
2817   packaging/rpm/SPECS/Makefile
2818   packaging/rpm/SPECS/wireshark.spec
2819   packaging/wix/Makefile
2820   plugins/Makefile
2821   plugins/epan/ethercat/Makefile
2822   plugins/epan/gryphon/Makefile
2823   plugins/epan/irda/Makefile
2824   plugins/epan/mate/Makefile
2825   plugins/epan/opcua/Makefile
2826   plugins/epan/profinet/Makefile
2827   plugins/epan/stats_tree/Makefile
2828   plugins/epan/transum/Makefile
2829   plugins/epan/unistim/Makefile
2830   plugins/epan/wimax/Makefile
2831   plugins/epan/wimaxasncp/Makefile
2832   plugins/epan/wimaxmacphy/Makefile
2833   plugins/wiretap/usbdump/Makefile
2834   plugins/codecs/l16_mono/Makefile
2835   _CUSTOM_PLUGIN_CONFIG_FILES_
2836   randpkt_core/doxygen.cfg
2837   randpkt_core/Makefile
2838   tools/Makefile
2839   tools/lemon/Makefile
2840   wiretap/Makefile
2841   writecap/Makefile
2842   writecap/doxygen.cfg
2843   wsutil/Makefile
2844 )
2845
2846 AC_OUTPUT
2847
2848
2849 # Pretty messages
2850
2851 if test "x$have_gtk" = "xyes"; then
2852         gtk_lib_message=" (with GTK+ v$GTK_VERSION)"
2853 fi
2854
2855 if test "x$have_qt" = "xyes" ; then
2856         enable_wireshark_qt="yes"
2857         qt_lib_message=" (with Qt$qt_version v$QT_VERSION)"
2858 else
2859         enable_wireshark_qt="no"
2860 fi
2861
2862 if test "x$enable_setcap_install" = "xyes" ; then
2863         setcap_message="yes"
2864 else
2865         setcap_message="no"
2866 fi
2867
2868 if test "x$enable_setuid_install" = "xyes" ; then
2869         setuid_message="yes"
2870 else
2871         setuid_message="no"
2872 fi
2873
2874 if test "x$DUMPCAP_GROUP" = "x" ; then
2875         dumpcap_group_message="(none)"
2876 else
2877         dumpcap_group_message="$DUMPCAP_GROUP"
2878 fi
2879
2880 if test "x$want_zlib" = "xno" ; then
2881         zlib_message="no"
2882 else
2883         zlib_message="yes"
2884 fi
2885
2886 if test "x$have_lua" = "xyes" ; then
2887         lua_message="yes"
2888 else
2889         lua_message="no"
2890 fi
2891
2892 if test "x$have_qt_multimedia_lib" = "xyes" ; then
2893         qt_multimedia_message="yes"
2894 else
2895         qt_multimedia_message="no"
2896 fi
2897
2898 if test "x$want_portaudio" = "xyes" ; then
2899         portaudio_message="yes"
2900 else
2901         portaudio_message="no"
2902 fi
2903
2904 if test "x$want_krb5" = "xno" ; then
2905         krb5_message="no"
2906 else
2907         krb5_message="yes ($ac_krb5_version)"
2908 fi
2909
2910 if test "x$have_good_c_ares" = "xyes" ; then
2911         c_ares_message="yes"
2912 else
2913         c_ares_message="no (name resolution will be disabled)"
2914 fi
2915
2916 if test "x$have_good_libcap" = "xyes" ; then
2917         libcap_message="yes"
2918 else
2919         libcap_message="no"
2920 fi
2921
2922 if test "x$have_good_maxminddb" = "xyes" ; then
2923         maxminddb_message="yes"
2924 else
2925         maxminddb_message="no"
2926 fi
2927
2928 if test "x$have_good_libssh" = "xyes" ; then
2929         libssh_message="yes"
2930         if test "x$have_ssh_userauth_agent" = "xno" ; then
2931                 ssh_userauth_agent_message=" (without ssh_userauth_agent)"
2932         fi
2933 else
2934         libssh_message="no"
2935 fi
2936
2937 if test "x$have_good_nghttp2" = "xyes" ; then
2938         nghttp2_message="yes"
2939 else
2940         nghttp2_message="no"
2941 fi
2942
2943 if test "x$have_good_bcg729" = "xyes" ; then
2944         bcg729_message="yes"
2945 else
2946         bcg729_message="no"
2947 fi
2948
2949 if test "x$have_wsug" = xyes -a "x$want_wsug" != xno; then
2950         wsug_message="yes"
2951 else
2952         wsug_message="no"
2953 fi
2954
2955 echo ""
2956 echo "  CPPFLAGS: $WS_CPPFLAGS $CPPFLAGS"
2957 echo ""
2958 echo "  CFLAGS: $WS_CFLAGS $CFLAGS"
2959 echo ""
2960 echo "  CXXFLAGS: $WS_CXXFLAGS $CXXFLAGS"
2961 echo ""
2962 echo "  LDFLAGS: $WS_LDFLAGS $LDFLAGS"
2963 echo ""
2964 echo "  LIBS: $LIBS"
2965
2966 echo ""
2967 echo "The Wireshark package has been configured with the following options:"
2968 echo "                       GLib version : v$GLIB_VERSION"
2969 echo "                    Build wireshark : $enable_wireshark_qt$qt_lib_message"
2970 echo "                Build wireshark-gtk : $have_gtk""$gtk_lib_message"
2971 echo "                       Build tshark : $enable_tshark"
2972 echo "                      Build tfshark : $enable_tfshark"
2973 echo "                     Build capinfos : $enable_capinfos"
2974 echo "                      Build captype : $enable_captype"
2975 echo "                      Build editcap : $enable_editcap"
2976 echo "                      Build dumpcap : $enable_dumpcap"
2977 echo "                     Build mergecap : $enable_mergecap"
2978 echo "                   Build reordercap : $enable_reordercap"
2979 echo "                    Build text2pcap : $enable_text2pcap"
2980 echo "                      Build randpkt : $enable_randpkt"
2981 echo "                       Build dftest : $enable_dftest"
2982 echo "                     Build rawshark : $enable_rawshark"
2983 echo "                       Build sharkd : $enable_sharkd"
2984 echo "                    Build fuzzshark : $enable_fuzzshark"
2985 echo "                  Build androiddump : $enable_androiddump"
2986 echo "                      Build sshdump : $enable_sshdump"
2987 echo "                    Build ciscodump : $enable_ciscodump"
2988 echo "                  Build randpktdump : $enable_randpktdump"
2989 echo "                      Build udpdump : $enable_udpdump"
2990 echo "          Build MaxMind DB resolver : $maxminddb_message"
2991 echo "                 Build User's Guide : $wsug_message"
2992 echo ""
2993 echo "    Save files as pcapng by default : $enable_pcap_ng_default"
2994 echo "  Install dumpcap with capabilities : $setcap_message"
2995 echo "             Install dumpcap setuid : $setuid_message"
2996 echo "                  Use dumpcap group : $dumpcap_group_message"
2997 echo "                        Use plugins : $have_plugins"
2998 echo "                    Use Lua library : $lua_message"
2999 echo "                Build Qt RTP player : $qt_multimedia_message"
3000 echo "              Build GTK+ RTP player : $portaudio_message"
3001 echo "                   Use pcap library : $want_pcap"
3002 echo "                   Use zlib library : $zlib_message"
3003 echo "               Use kerberos library : $krb5_message"
3004 echo "                 Use c-ares library : $c_ares_message"
3005 echo "                Use SMI MIB library : $have_libsmi"
3006 echo "             Use GNU gcrypt library : yes"
3007 echo "                 Use GnuTLS library : $tls_message"
3008 echo "     Use POSIX capabilities library : $libcap_message"
3009 echo "                 Use libssh library : ${libssh_message}${ssh_userauth_agent_message}"
3010 echo "                     Use nl library : $libnl_message"
3011 echo "              Use SBC codec library : $have_sbc"
3012 echo "                Use SpanDSP library : $have_spandsp"
3013 echo "                 Use bcg729 library : $bcg729_message"
3014 echo "                Use libxml2 library : $have_libxml2"
3015 echo "                Use nghttp2 library : $nghttp2_message"
3016 echo "                    Use LZ4 library : $have_lz4"
3017 echo "                 Use Snappy library : $have_snappy"
3018 #echo "       Use GDK-Pixbuf with GResource: $have_gresource_pixbuf"
3019
3020 # We're slowly migrating to CMake. The following still use or refer
3021 # to Autotools:
3022 # - .travis.yml
3023 # - INSTALL and INSTALL.configure
3024 # - README.bsd
3025 # - README.md
3026 # - doc/README.packaging
3027 # - doc/README.idl2wrs
3028 # - doc/README.plugins
3029 # - docbook/wsdg_src/WSDG_chapter_dissection.asciidoc
3030 # - docbook/wsdg_src/WSDG_chapter_sources.asciidoc
3031 # - docbook/wsug_src/WSUG_chapter_build_install.asciidoc
3032 # - tools/git-compare-abis.sh
3033 echo ""
3034 AC_MSG_NOTICE([Builds using Autotools might be removed in the future.])