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