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