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