Fix crash when exporting packet dissection as plain text on Windows (regression intro...
[metze/wireshark/wip.git] / configure.ac
1 # $Id$
2 #
3 AC_PREREQ(2.60)
4
5 m4_define([version_major], [1])
6 m4_define([version_minor], [9])
7 m4_define([version_micro], [0])
8 m4_define([version_micro_extra], version_micro)
9 m4_append([version_micro_extra], [])
10
11 AC_INIT(wireshark, [version_major.version_minor.version_micro_extra], http://bugs.wireshark.org/, , http://www.wireshark.org/)
12
13 dnl Check for CPU / vendor / OS
14 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
15 dnl `AC_CANONICAL_HOST', or `AC_CANONICAL_TARGET', depending on the
16 dnl needs.  Using `AC_CANONICAL_TARGET' is enough to run the two other
17 dnl macros.
18 dnl
19 dnl As nothing in the Wireshark is itself a build tool (we are not,
20 dnl for example, a compiler that generates machine code), we probably
21 dnl don't need AC_CANONICAL_TARGET, so, in theory, we should be able
22 dnl to use AC_CANONICAL_BUILD and AC_CANONICAL_HOST - or perhaps just
23 dnl AC_CANONICAL_HOST - instead.  Note that we do have tools, such as
24 dnl lemon, that need to be built for the build machine, not for the
25 dnl host machine, so we might need both.
26 dnl
27 dnl This has to be done *after* AC_INIT, otherwise autogen.sh fails.
28
29 dnl AC_CANONICAL_BUILD
30 dnl AC_CANONICAL_HOST
31 AC_CANONICAL_TARGET
32
33 AM_INIT_AUTOMAKE([1.9 tar-ustar dist-bzip2 no-dist-gzip])
34
35 # Make Wireshark's version available in config.h
36 AC_DEFINE(VERSION_MAJOR, version_major, [Wireshark's major version])
37 AC_DEFINE(VERSION_MINOR, version_minor, [Wireshark's minor version])
38 AC_DEFINE(VERSION_MICRO, version_micro, [Wireshark's micro version])
39
40 AM_DISABLE_STATIC
41
42 dnl Checks for programs.
43 AC_PROG_CC
44 AM_PROG_CC_C_O
45 AC_PROG_CXX
46 AC_PROG_CPP
47 dnl Work around libtool bug (fixed in the version 1.5a?)
48 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
49 AC_LIBTOOL_DLOPEN
50 AC_PROG_LIBTOOL
51 AC_PATH_PROG(PERL, perl)
52 #
53 # XXX - should autogen.sh check for YACC/Bison and Flex?  A user building
54 # from a distribution tarball shouldn't have to have YACC/Bison or Flex,
55 # as the tarball should contain the results of running YACC/Bison on .y
56 # files and running Flex on .l files, but a user building from SVN
57 # will have to run YACC/Bison and Flex to process those files.
58 #
59 # On the other hand, what about users who use a distribution tarball to
60 # do development?  They *shouldn't* - that's what the SVN repository is
61 # for - but they might.  They'd get errors if they modify a .y or .l
62 # file and try to do a build - but the error should tell them that they
63 # need to get YACC/Bison and/or Flex.
64 #
65 # Then again, getting them shouldn't be too big of a burden.
66 #
67 # XXX - is the same true of pod2man and pod2html, or are they needed
68 # even when building from a distribution tarball?
69 #
70 #
71 AC_PROG_YACC
72 AC_PATH_PROG(YACCDUMMY, $YACC)
73 if test "x$YACCDUMMY" = x
74 then
75         AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
76 fi
77 AM_PROG_LEX
78 AC_PATH_PROG(LEX, flex)
79 if test "x$LEX" = x
80 then
81         AC_MSG_ERROR(I couldn't find flex; make sure it's installed and in your path)
82 fi
83 AC_PATH_PROG(POD2MAN, pod2man)
84 if test "x$POD2MAN" = x
85 then
86         #
87         # The alternative is not to build the man pages....
88         #
89         AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
90 fi
91 AC_PATH_PROG(POD2HTML, pod2html)
92 if test "x$POD2HTML" = x
93 then
94         #
95         # The alternative is not to build the HTML man pages....
96         #
97         AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
98 fi
99
100 #
101 # XXX - this looks for various HTML viewers on the host, not the target;
102 # we really want to know what's available on the target, for cross-builds.
103 # That would probably require us to, at run time, look for xdg-open and,
104 # if we don't find it, look for mozilla, htmlview, etc.
105 #
106 AC_PATH_PROG(HTML_VIEWER, xdg-open)
107 if test "x$HTML_VIEWER" != x
108 then
109         #
110         # XXX - the HTML_VIEWER shell variable is the full path of xdg-open.
111         # Define some variable to be that, so we just run that?
112         #
113         AC_DEFINE(HAVE_XDG_OPEN, 1, [Define if we have xdg-open])
114
115         #
116         # XXX - we have to define HTML_VIEWER for the prefs.c code that
117         # sets the default value of the Web browser preference, even
118         # though that preference won't be offered.
119         #
120         AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
121 else
122         AC_PATH_PROG(HTML_VIEWER, htmlview)
123         if test "x$HTML_VIEWER" = x
124         then
125                 AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
126         else
127                 AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
128         fi
129 fi
130
131 AC_PATH_PROG(PYTHON, python)
132
133 AC_SUBST(PERL)
134 AC_SUBST(LEX)
135 AC_SUBST(POD2MAN)
136 AC_SUBST(POD2HTML)
137 AC_SUBST(PYTHON)
138 AC_SUBST(XSLTPROC)
139 AC_SUBST(XMLLINT)
140
141 #
142 # Set "ac_supports_gcc_flags" if the compiler is known to support GCC-style
143 # flags such as -pedantic, -W warning flags and -f feature flags.  Currently,
144 # we assume GCC and clang do; other compilers should be added here.
145 #
146 # This is done to avoid getting tripped up by compilers that support
147 # those flags but give them a different meaning.
148 #
149 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
150         ac_supports_gcc_flags=yes
151 fi
152
153 #
154 # Set "ac_supports_W_linker_passthrough" if the compiler is known to
155 # support "-Wl,{options}" to pass options through to the linker.
156 # Currently, we assume GCC, xlc, and clang do; other compilers should
157 # be added here.
158 #
159 if test "x$GCC" = "xyes" -o "x$CC" = "xxlc" -o "x$CC" = "xclang" ; then
160         ac_supports_W_linker_passthrough=yes
161 fi
162
163 #
164 # Set "ac_supports_attribute_unused" if the compiler is known to
165 # support "__attribute__(unused)".
166 # Currently, we assume GCC and clang do; other compilers should
167 # be added here.
168 #
169 # XXX - do this with a compiler test?
170 #
171 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
172         ac_supports_W_linker_passthrough=yes
173 fi
174
175 if test "x$CC_FOR_BUILD" = x
176 then
177        CC_FOR_BUILD=$CC
178 fi
179 AC_SUBST(CC_FOR_BUILD)
180
181 # Check for doxygen
182 AC_PATH_PROG(DOXYGEN, doxygen)
183 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
184 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
185
186 #
187 # Try to arrange for large file support.
188 #
189 AC_SYS_LARGEFILE
190
191 # GnuTLS
192 # Version 3.0 switched from LGPLv2.1+ to LGPLv3+.
193 tls_message="no"
194 AC_ARG_WITH([gnutls],
195   AC_HELP_STRING( [--with-gnutls=@<:@yes/no@:>@],
196                   [use GnuTLS library @<:@default=yes@:>@]),
197   with_gnutls="$withval", with_gnutls="yes")
198 if test "x$with_gnutls" = "xyes"; then
199   PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 1.2.0 gnutls < 3],
200         [
201                 echo "GnuTLS found, enabling SSL decryption"
202                 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use GnuTLS library])
203                 tls_message="yes"
204         ]
205         , [
206                 echo "GnuTLS not found, disabling SSL decryption"
207                 tls_message="no"
208         ]
209   )
210 fi
211
212 # libgrypt
213 gcrypt_message="no"
214 AC_ARG_WITH([gcrypt],
215   AC_HELP_STRING( [--with-gcrypt=@<:@yes/no@:>@],
216                   [use gcrypt library @<:@default=yes@:>@]),
217   with_gcrypt="$withval", with_gcrypt="yes")
218 if test "x$with_gcrypt" = "xyes"; then
219   AM_PATH_LIBGCRYPT(1.1.92,
220         [
221                 echo "libgcrypt found, enabling ipsec decryption"
222                 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
223                 gcrypt_message="yes"
224         ]
225         , [
226                 if test x$libgcrypt_config_prefix != x ; then
227                         AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
228                 else
229                         echo "libgcrypt not found, disabling ipsec decryption"
230                         gcrypt_message="no"
231                 fi
232         ]
233   )
234 fi
235
236 AC_ARG_WITH([qt],
237   AC_HELP_STRING( [--with-qt=@<:@yes/no@:>@],
238                   [use Qt instead of GTK+ @<:@default=no@:>@]),
239   with_qt="$withval", with_qt="no")
240
241 libnl_message="no"
242 PKG_CHECK_MODULES(LIBNL3, [libnl-route-3.0 >= 3.0 libnl-genl-3.0] >= 3.0, [have_libnl3=yes], [have_libnl3=no])
243 PKG_CHECK_MODULES(LIBNL2, libnl-2.0 >= 2.0, [have_libnl2=yes], [have_libnl2=no])
244 PKG_CHECK_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
245 if (test "${have_libnl3}" = "yes"); then
246         CFLAGS="$CFLAGS $LIBNL3_CFLAGS"
247         LIBS="$LIBS $LIBNL3_LIBS"
248         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
249         AC_DEFINE(HAVE_LIBNL3, 1, [libnl version 3])
250         libnl_message="yes (v3)"
251         enable_airpcap=no
252 elif (test "${have_libnl2}" = "yes"); then
253         CFLAGS="$CFLAGS $LIBNL2_CFLAGS"
254         LIBS="$LIBS $LIBNL2_LIBS"
255         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
256         AC_DEFINE(HAVE_LIBNL2, 1, [libnl version 2])
257         libnl_message="yes (v2)"
258         enable_airpcap=no
259 elif (test "${have_libnl1}" = "yes"); then
260         CFLAGS="$CFLAGS $LIBNL1_CFLAGS"
261         LIBS="$LIBS $LIBNL1_LIBS"
262         AC_DEFINE(HAVE_LIBNL, 1, [Enable libnl support])
263         AC_DEFINE(HAVE_LIBNL1, 1, [libnl version 1])
264         libnl_message="yes (v1)"
265         enable_airpcap=no
266 fi
267
268 AC_MSG_CHECKING([if nl80211.h is new enough])
269   AC_TRY_COMPILE([#include <linux/nl80211.h>],
270     [int x = NL80211_FREQUENCY_ATTR_MAX_TX_POWER;
271         x = NL80211_ATTR_SUPPORTED_IFTYPES;
272         x = NL80211_ATTR_SUPPORTED_COMMANDS;
273         x = NL80211_ATTR_WIPHY_FREQ;
274         x = NL80211_CHAN_NO_HT;],
275     [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211, 1, [nl80211.h is new ehough])],
276     [AC_MSG_RESULT(no)])
277
278 AC_MSG_CHECKING([for NL80211_SET_CHANNEL])
279   AC_TRY_COMPILE([#include <linux/nl80211.h>],
280     [enum nl80211_commands x = NL80211_CMD_SET_CHANNEL;],
281     [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_NL80211_CMD_SET_CHANNEL, 1, [SET_CHANNEL is supported])],
282     [AC_MSG_RESULT(no)])
283
284
285 AC_ARG_WITH([gtk3],
286   AC_HELP_STRING( [--with-gtk3=@<:@yes/no@:>@],
287                   [use GTK+ 3.0 instead of 2.0 @<:@default=no@:>@]),
288   with_gtk3="$withval", with_gtk3="no")
289
290 # libsmi
291 # FIXME: currently the path argument to with-libsmi is being ignored
292 AX_LIBSMI
293
294 # Check for xsltproc
295 AC_PATH_PROG(XSLTPROC, xsltproc)
296 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
297 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
298
299 # Check for xmllint
300 AC_PATH_PROG(XMLLINT, xmllint)
301 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
302 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
303
304 # Check for fop (translate .fo to e.g. pdf)
305 AC_PATH_PROG(FOP, fop)
306 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
307 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
308
309 #
310 # Look for something to convert HTML to text (for docbook/)
311 #
312 AC_PATH_PROG(ELINKS, elinks)
313 AC_CHECK_PROG(HAVE_ELINKS, elinks, "yes", "no")
314 AM_CONDITIONAL(HAVE_ELINKS, test x$HAVE_ELINKS = xyes)
315
316 ## links: Fails as used in docbook/Makefile.am
317 ## (Rather than fixing things we'll just disable the use of links).
318 ##AC_PATH_PROG(LINKS, links)
319 ##AC_CHECK_PROG(HAVE_LINKS, links, "yes", "no")
320 ##AM_CONDITIONAL(HAVE_LINKS, test x$HAVE_LINKS = xyes)
321
322 AC_PATH_PROG(LYNX, lynx)
323 AC_CHECK_PROG(HAVE_LYNX, lynx, "yes", "no")
324 AM_CONDITIONAL(HAVE_LYNX, test x$HAVE_LYNX = xyes)
325
326
327 # Check for hhc (html help compiler)
328 AC_PATH_PROG(HHC, hhc.exe)
329 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
330 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
331
332 # Check for packaging utilities
333 # For now, we check to see if the various packaging utilites are in our
334 # path.  I'm too lazy to write code to go hunt for them.  -  Gerald
335
336 # SVR4/Solaris
337 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
338 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
339 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
340
341 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
342      -a x$HAVE_PKGTRANS = xyes ; then
343   HAVE_SVR4_PACKAGING=yes
344 else
345   HAVE_SVR4_PACKAGING=no
346 fi
347 AC_SUBST(HAVE_SVR4_PACKAGING)
348
349 # RPM
350 AC_WIRESHARK_RPM_CHECK
351 AC_SUBST(HAVE_RPM)
352
353 # Debian
354 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
355
356 # Mac OS X
357 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
358 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
359 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
360
361 if test x$HAVE_XCODEBUILD = xyes -a x$HAVE_HDIUTIL = xyes \
362      -a x$HAVE_BLESS = xyes ; then
363   HAVE_OSX_PACKAGING=yes
364 else
365   HAVE_OSX_PACKAGING=no
366 fi
367 AC_SUBST(HAVE_OSX_PACKAGING)
368
369 #
370 # Try to add some additional gcc checks to CFLAGS
371 #
372 AC_ARG_ENABLE(extra-gcc-checks,
373   AC_HELP_STRING( [--enable-extra-gcc-checks],
374                   [do additional -W checks in GCC @<:@default=no@:>@]),
375 [
376         wireshark_extra_gcc_flags=$enableval
377         if test $enableval != no
378         then
379                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-pedantic)
380                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Woverflow)
381                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wlogical-op)
382                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-overlength-strings)
383 #               AC_WIRESHARK_GCC_CFLAGS_CHECK(-fstrict-overflow -Wstrict-overflow=4)
384 #               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wunreachable-code)
385 #               AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wunsafe-loop-optimizations)
386                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-long-long)
387                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wbad-function-cast, C)
388                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-qual)
389                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Waddress)
390                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
391                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wattributes)
392                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdiv-by-zero)
393                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wignored-qualifiers)
394                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpragmas)
395                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wredundant-decls)
396                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wvla)
397                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wc++-compat, C)
398                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wjump-misses-init, C)
399                 #
400                 # epan/dissectors/packet-ncp2222.inc blocks this one
401                 # for now.
402                 #
403                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
404                 #
405                 # GLib blocks this for now.
406                 #
407                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wstrict-prototypes)
408                 #
409                 # All the registration functions block these for now.
410                 #
411                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-prototypes)
412                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-declarations)
413                 #
414                 # epan/dissectors/packet-afs.c blocks this one for now.
415                 #
416                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshadow)
417                 #
418                 # More cleanup needed for this on LP64.
419                 #
420                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
421         fi
422 ],)
423 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wall -W) # -W is now known as -Wextra
424 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wextra) # -W is now known as -Wextra
425 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement, C)
426 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wendif-labels)
427 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpointer-arith)
428 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-pointer-sign, C)
429 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
430 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
431 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wformat-security)
432 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wold-style-definition, C)
433 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-error=unused-but-set-variable)    ##  for now
434 #
435 # Use the faster pre gcc 4.5 floating point precision if available;
436 # clang doesn't error out on -f options that it doesn't know about,
437 # it just warns and ignores them, so this check doesn't cause us
438 # to omit -fexcess-precision=fast, which produces a pile of
439 # annoying warnings.
440 #
441 if test "x$CC" != "xclang" ; then
442   AC_WIRESHARK_GCC_CFLAGS_CHECK(-fexcess-precision=fast)
443 fi
444
445 AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--as-needed])
446 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,-M])
447 ###AC_WIRESHARK_LDFLAGS_CHECK([-Wl,--cref])
448 # AC_WIRESHARK_LDFLAGS_CHECK([-flto])
449 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhopr])
450 # AC_WIRESHARK_LDFLAGS_CHECK([-fwhole-program])
451
452 #
453 # If we're running GCC or clang define _U_ to be "__attribute__((unused))"
454 # so we can use _U_ to flag unused function parameters and not get warnings
455 # about them. Otherwise, define _U_ to be an empty string so that _U_ used
456 # to flag an unused function parameters will compile with other compilers.
457 #
458 # XXX - similar hints for other compilers?
459 #
460 if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
461   AC_DEFINE(_U_, __attribute__((unused)), [Hint to the compiler that a function parameters is not used])
462 else
463   AC_DEFINE(_U_, , [Hint to the compiler that a function parameters is not used])
464 fi
465
466 # If we're running GCC or CLang, use FORTIFY_SOURCE=2
467 #  (only if the GCC 'optimization level' > 0).
468 #
469 # See: http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
470 # See: http://sourceware.org/bugzilla/show_bug.cgi?id=13979
471 #
472 # Note: FORTIFY_SOURCE is only effective for gcc optimization level > 0 (-O1, etc)
473 AC_WIRESHARK_GCC_FORTIFY_SOURCE_CHECK
474
475 #
476 # If the compiler supports GCC-style flags, enable a barrier "stop on
477 # warning".
478 # This barrier is set for a very large part of the code. However, it is
479 # typically not set for "generated" code  (flex, ans2wrs, idl2wrs, ...)
480 #
481 warnings_as_errors_default="yes"
482 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
483 AC_ARG_ENABLE(warnings-as-errors,
484   AC_HELP_STRING( [--enable-warnings-as-errors],
485                   [treat warnings as errors (only for GCC or clang) @<:@default=yes@:>@]),
486 [
487   if test "x$ac_supports_gcc_flags" = "xyes" -a "x$enableval" = "xyes" -a "x$wireshark_extra_gcc_flags" != "xyes"; then
488     with_warnings_as_errors="yes"
489     AC_MSG_RESULT(yes)
490   else
491     with_warnings_as_errors="no"
492     AC_MSG_RESULT(no)
493   fi
494 ],
495   if test "x$ac_supports_gcc_flags" = "xyes" -a "x$wireshark_extra_gcc_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
496     with_warnings_as_errors="yes"
497     AC_MSG_RESULT(yes)
498   else
499     with_warnings_as_errors="no"
500     AC_MSG_RESULT(no)
501   fi
502 )
503 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
504
505 #
506 # Add any platform-specific compiler flags needed.
507 #
508 AC_MSG_CHECKING(for platform-specific compiler flags)
509 if test "x$GCC" = "xyes" ; then
510         #
511         # GCC - do any platform-specific tweaking necessary.
512         #
513         case "$host_os" in
514         solaris*)
515                 # the X11 headers don't automatically include prototype info
516                 # and a lot don't include the return type
517                 CPPFLAGS="$CPPFLAGS -DFUNCPROTO=15"
518                 CFLAGS="$CFLAGS -Wno-return-type"
519                 CXXFLAGS="$CXXFLAGS -Wno-return-type"
520                 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
521                 ;;
522         *)
523                 AC_MSG_RESULT(none needed)
524                 ;;
525         esac
526 else
527         #
528         # Not GCC - assume it's the vendor's compiler.
529         #
530         case "$host_os" in
531         hpux*)
532                 #
533                 # HP's ANSI C compiler; flags suggested by Jost Martin.
534                 # "-Ae" for ANSI C plus extensions such as "long long".
535                 # "+O2", for optimization.  XXX - works with "-g"?
536                 #
537                 # HP's ANSI C++ compiler doesn't support "-Ae", but
538                 # does support "+O2", at least according to the
539                 # documentation I can find online.
540                 #
541                 CFLAGS="-Ae +O2 $CFLAGS"
542                 CXXFLAGS="+O2 $CFLAGS"
543                 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
544                 ;;
545         *)
546                 AC_MSG_RESULT(none needed)
547                 ;;
548         esac
549 fi
550
551 #
552 # Add any platform-specific linker flags needed.
553 #
554 AC_MSG_CHECKING(for platform-specific linker flags)
555 case "$host_os" in
556 darwin*)
557         #
558         # Add -Wl,-single_module to the LDFLAGS used with shared
559         # libraries, to fix some error that show up in some cases;
560         # some Apple documentation recommends it for most shared
561         # libraries.
562         #
563         LDFLAGS_SHAREDLIB="-Wl,-single_module"
564         #
565         # Add -Wl,-search_paths_first to make sure that if we search
566         # directories A and B, in that order, for a given library, a
567         # non-shared version in directory A, rather than a shared
568         # version in directory B, is chosen (so we can use
569         # --with-pcap=/usr/local to force all programs to be linked
570         # with a static version installed in /usr/local/lib rather than
571         # the system version in /usr/lib).
572         #
573         LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
574         AC_MSG_RESULT([Apple linker - added -Wl,-single_module and -Wl,-search_paths_first])
575         ;;
576 cygwin*)
577         #
578         # Shared libraries in cygwin/Win32 must never contain
579         # undefined symbols.
580         #
581         LDFLAGS="$LDFLAGS -no-undefined"
582         AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
583         ;;
584 *)
585         AC_MSG_RESULT(none needed)
586         ;;
587 esac
588 AC_SUBST(LDFLAGS_SHAREDLIB)
589
590 # Control silent compiling
591 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([no])])
592
593 #
594 # On OS X, if we find the headers for Core Foundation, Launch Services,
595 # and Core Services, add -framework options to link with Application
596 # Services (of which Launch Services is a subframework), Core Foundation
597 # (required by the Launch Services APIs), and Core Services, so we can
598 # use them to launch a Web browser from the Help menu and to use
599 # Gestalt() to get the Mac OS X version number.
600 #
601 case "$host_os" in
602
603 darwin*)
604         AC_MSG_CHECKING([whether we can build with Core Foundation, Launch Services, and Core Services])
605         ac_save_LIBS="$LIBS"
606         ac_coreservices_frameworks="-framework CoreServices"
607         ac_launchservices_frameworks="-framework ApplicationServices -framework CoreFoundation $ac_coreservices_frameworks"
608         LIBS="$LIBS $ac_launchservices_frameworks $ac_coreservices_frameworks"
609         AC_TRY_LINK(
610            [
611 #       include <CoreFoundation/CFBase.h>
612 #       include <CoreFoundation/CFString.h>
613 #       include <CoreFoundation/CFURL.h>
614 #       include <ApplicationServices/ApplicationServices.h>
615            ],
616            [
617         CFStringRef url_CFString;
618         CFURLRef url_CFURL;
619         OSStatus status;
620
621         url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
622         url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
623         status = LSOpenCFURLRef(url_CFURL, NULL);
624            ],
625            ac_cv_can_use_osx_frameworks=yes,
626            ac_cv_can_use_osx_frameworks=no,
627            [echo $ac_n "cross compiling; assumed OK... $ac_c"])
628         if test "$ac_cv_can_use_osx_frameworks" = yes ; then
629                 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
630                 CORESERVICES_FRAMEWORKS="$ac_coreservices_frameworks"
631                 LAUNCHSERVICES_FRAMEWORKS="$ac_launchservices_frameworks"
632                 AC_MSG_RESULT(yes)
633
634                 #
635                 # OK, so we have the OS X frameworks; do they include
636                 # CFPropertyListCreateWithStream, or do we have
637                 # to fall back on CFPropertyListCreateFromStream?
638                 # (They only differ in the error return, which we
639                 # don't care about.  And, no, we shouldn't just
640                 # use CFPropertyListCreateFromStream, because it's
641                 # deprecated in newer releases.)
642                 #
643                 AC_CHECK_FUNCS(CFPropertyListCreateWithStream)
644         else
645                 AC_MSG_RESULT(no)
646         fi
647         LIBS="$ac_save_LIBS"
648         ;;
649 esac
650 AC_SUBST(CORESERVICES_FRAMEWORKS)
651 AC_SUBST(LAUNCHSERVICES_FRAMEWORKS)
652
653 #
654 # If using $prefix we add "$prefix/include" to the include search path
655 # and "$prefix/lib" to the library search path.
656 #
657 if test "x$prefix" != "x" ; then
658         AC_MSG_CHECKING(whether to use $prefix for headers and libraries)
659         if test -d $prefix/include ; then
660                 AC_MSG_RESULT(yes)
661                 #
662                 # Arrange that we search for header files in "$prefix/include", as
663                 # various packages we use may have been installed under "$prefix/include".
664                 #
665                 CPPFLAGS="$CPPFLAGS -I$prefix/include"
666
667                 #
668                 # Arrange that we search for libraries in "$prefix/lib".
669                 #
670                 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, $prefix/lib)
671         else
672                 AC_MSG_RESULT(no)
673         fi
674 fi
675
676 dnl Look in /usr/local for header files and libraries ?
677 dnl XXX FIXME don't include /usr/local if it is already in the system
678 dnl search path as this causes gcc 3.2 on Linux to complain about a change
679 dnl of the system search order for includes
680 AC_ARG_ENABLE(usr-local,
681   AC_HELP_STRING( [--enable-usr-local],
682                   [look for headers and libs in /usr/local tree @<:@default=yes@:>@]),
683     ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
684
685 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
686 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
687         if test -d "/usr/local"; then
688                 AC_MSG_RESULT(yes)
689                 #
690                 # Arrange that we search for header files in the source directory
691                 # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
692                 # as various packages we use ("libpcap", "zlib", "adns")
693                 # may have been installed under "/usr/local/include".
694                 #
695                 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
696
697                 #
698                 # Arrange that we search for libraries in "/usr/local/lib".
699                 #
700                 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
701         else
702                 AC_MSG_RESULT(no)
703         fi
704 else
705         AC_MSG_RESULT(no)
706 fi
707
708 #
709 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
710 # link directory.
711 #
712 case "$host_os" in
713   solaris*)
714     AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
715     if test x$LD_LIBRARY_PATH != x ; then
716       LIBS="$LIBS -R$LD_LIBRARY_PATH"
717       AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
718     else
719       AC_MSG_RESULT(no -- this may be a problem in a few seconds)
720     fi
721   ;;
722 esac
723
724 #
725 # Check for versions of "sed" inadequate to handle, in libtool, a list
726 # of object files as large as the list in Wireshark.
727 #
728 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
729 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
730 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
731 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
732 # is the only "sed" that comes with Solaris that can handle Wireshark.
733 #
734 # Add any checks here that are necessary for other OSes.
735 #
736 AC_WIRESHARK_GNU_SED_CHECK
737 if test "$HAVE_GNU_SED" = no ; then
738         case "$host_os" in
739         solaris*)
740                 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
741                 case `which sed` in
742                         /bin/sed|/usr/bin/sed|/usr/ucb/sed)
743                         AC_MSG_RESULT(yes)
744                         AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
745                         ;;
746
747                         *)
748                         AC_MSG_RESULT(no)
749                         ;;
750                 esac
751                 ;;
752
753         *)
754                 :
755                 ;;
756         esac
757 fi
758
759 # Enable/disable wireshark
760
761 AC_ARG_ENABLE(wireshark,
762   AC_HELP_STRING( [--enable-wireshark],
763                   [build GTK+-based Wireshark @<:@default=yes, if GTK+ available@:>@]),
764     enable_wireshark=$enableval,enable_wireshark=yes)
765
766 AC_ARG_ENABLE(packet-editor,
767   AC_HELP_STRING( [--enable-packet-editor],
768                   [add support for packet editor in Wireshark @<:@default=no@:>@]),
769     enable_packet_editor=$enableval,enable_packet_editor=no)
770 if test x$enable_packet_editor = xyes; then
771         AC_DEFINE(WANT_PACKET_EDITOR, 1, [Support for packet editor])
772 fi
773
774 AC_ARG_ENABLE(profile-build,
775   AC_HELP_STRING( [--enable-profile-build],
776                   [build profile-ready binaries @<:@default=no@:>@]),
777     enable_profile_build=$enableval,enable_profile_build=no)
778 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
779 AC_MSG_CHECKING(if profile builds must be generated)
780 if test "x$enable_profile_build" = "xyes" ; then
781         if test "x$GCC" = "xyes" -o "x$CLANG" = "xyes" ; then
782                 AC_MSG_RESULT(yes)
783                 CFLAGS=" -pg $CFLAGS"
784                 CXXFLAGS=" -pg $CXXFLAGS"
785         else
786                 AC_MSG_RESULT(no)
787                 echo "Building profile binaries currently only supported for GCC and clang."
788         fi
789 else
790         AC_MSG_RESULT(no)
791 fi
792
793 # Create DATAFILE_DIR #define for config.h
794 datafiledir=$datadir/wireshark
795 datafiledir=`(
796     test "x$prefix" = xNONE && prefix=$ac_default_prefix
797     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
798     # Ugly hack, but I don't see how this problem can be solved
799     # properly that DATAFILE_DIR had a value starting with
800     # "${prefix}/" instead of e.g. "/usr/local/"
801     eval eval echo "$datafiledir"
802 )`
803 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
804
805 # Create DOC_DIR #define for config.h
806 docdir=`(
807     test "x$prefix" = xNONE && prefix=$ac_default_prefix
808     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
809     # Ugly hack, but I don't see how this problem can be solved
810     # properly that DOC_DIR had a value starting with
811     # "${prefix}/" instead of e.g. "/usr/local/"
812     eval eval echo "$docdir"
813 )`
814 AC_DEFINE_UNQUOTED(DOC_DIR, "$docdir", [Directory for docs])
815
816 # GTK+ and Qt checks; we require GTK+ 2.12 or later, and, for now,
817 # don't require any particular version of Qt (except perhaps by
818 # implication, as older versions might not support pkgconfig).
819 #
820 # We only do those if we're going to be building Wireshark;
821 # otherwise, we don't have any GUI to build, so we don't use
822 # GTK+ or Qt.
823 #
824 # We don't add $GTK_LIBS or $Qt_LIBS to LIBS, because we don't want to
825 # force all programs to be built with GTK+ or Qt.
826 #
827 # Release dates for GTK+ versions:
828 # 2.12.0: 14 Sep 2007
829 # 2.14.0: 04 Sep 2008
830 # 2.16.0: 13 Mar 2009
831 # 2.18.0: 23 Sep 2009
832 # 2.20.0: 23 Mar 2010
833 # 2.22.0: 23 Sep 2010
834 # 2.24.0: 30 Jan 2011
835 # 3.0.0:  10 Feb 2011
836 # 3.2.0:  25 Sep 2011
837 # 3.4.0:  26 Mar 2012
838 # 3.6.0:  24 Sep 2012
839
840 if test "x$enable_wireshark" = "xyes"; then
841         if test "x$with_qt" = "xyes"; then
842                 PKG_CHECK_MODULES([Qt], [QtCore QtGui],
843                 [
844                         CFLAGS="$CFLAGS $Qt_CFLAGS"
845                         CXXFLAGS="$CXXFLAGS $Qt_CFLAGS"
846                         #
847                         # XXX - greasy hack to make ui/gtk/recent.c
848                         # compile.
849                         #
850                         CPPFLAGS="-DQT_GUI_LIB $CPPFLAGS"
851                         have_qt=yes
852                 ],
853                 [
854                         AC_MSG_ERROR([Qt is not available])
855                 ])
856
857                 #
858                 # We don't know whether we have GTK+, but we
859                 # won't be using it, so it's as if we don't
860                 # have it.
861                 #
862                 have_gtk=no
863         else
864                 #
865                 # Not Qt - either GTK+ 3.x or 2.x.
866                 #
867                 if test "x$with_gtk3" = "xyes"; then
868                         AM_PATH_GTK_3_0(3.0.0,
869                         [
870                                 CFLAGS="$CFLAGS $GTK_CFLAGS"
871                                 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
872                                 have_gtk=yes
873                                 AC_DEFINE(HAVE_GTK, 1,
874                                     [Define to 1 if compiling with GTK])
875                         ], have_gtk=no)
876
877                 else
878                         AM_PATH_GTK_2_0(2.12.0,
879                         [
880                                 CFLAGS="$CFLAGS $GTK_CFLAGS"
881                                 CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"
882                                 have_gtk=yes
883                                 AC_DEFINE(HAVE_GTK, 1,
884                                     [Define to 1 if compiling with GTK])
885                         ], have_gtk=no)
886                 fi
887         fi
888 else
889         have_qt=no
890         have_gtk=no
891 fi
892
893 # GLib checks; we require GLib 2.14 or later, and require gmodule
894 # support, as we need that for dynamically loading plugins.
895 # If we found GTK+, this doesn't add GLIB_CFLAGS to CFLAGS, because
896 # AM_PATH_GTK will add GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a
897 # superset of GLIB_CFLAGS.  If we didn't find GTK+, it does add
898 # GLIB_CFLAGS to CFLAGS.
899 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
900 # set when generating the Makefile, so we can make programs that require
901 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
902 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
903 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
904 # programs to be built with GLib.
905 #
906 # Release dates for GLib versions:
907 # 2.14.0: 03 Aug 2007
908 # 2.16.0: 10 Mar 2008
909 # 2.18.0: 02 Sep 2008
910 # 2.20.0: 13 Mar 2009
911 # 2.22.0: 22 Sep 2009
912 # 2.24.0: 28 Mar 2010
913 # 2.26.0: 27 Sep 2010
914 # 2.28.0: 08 Feb 2011
915 # 2.30.0: 27 Sep 2011
916 # 2.32.0: 24 Mar 2012
917 # 2.34.0: 24 Sep 2012
918
919 if test "$have_gtk" = "no" ; then
920         #
921         # We don't have GTK+.
922         #
923         if test "$have_qt" = "yes" ; then
924                 #
925                 # However, we do have Qt, and thus will be building
926                 # Wireshark (if the user had explicitly disabled
927                 # Wireshark, we wouldn't have looked for Qt, so we
928                 # wouldn't think we had it, and thus wouldn't be here).
929                 #
930                 wireshark_bin="wireshark\$(EXEEXT)"
931                 wireshark_man="wireshark.1"
932                 wireshark_SUBDIRS="codecs ui/qt"
933         else
934                 #
935                 # We don't have Qt, either, which means we have no UI
936                 # toolkit.
937                 #
938                 # If they didn't explicitly say "--disable-wireshark",
939                 # fail (so that, unless they explicitly indicated that
940                 # they don't want Wireshark, we stop so they know they
941                 # won't be getting Wireshark unless they fix the GTK+/Qt
942                 # problem).
943                 #
944                 if test "x$enable_wireshark" = "xyes"; then
945                         if test "x$with_gtk3" = "xyes"; then
946                                 AC_MSG_ERROR([GTK+ 3.0 or later isn't available, so Wireshark can't be compiled])
947                         else
948                                 AC_MSG_ERROR([Neither Qt nor GTK+ 2.12 or later are available, so Wireshark can't be compiled])
949                         fi
950                 fi
951                 wireshark_bin=""
952                 wireshark_man=""
953         fi
954         # Use GLIB_CFLAGS
955         AM_PATH_GLIB_2_0(2.14.0,
956         [
957                 CFLAGS="$CFLAGS $GLIB_CFLAGS"
958                 CXXFLAGS="$CXXFLAGS $GLIB_CFLAGS"
959         ], AC_MSG_ERROR(GLib 2.14 or later distribution not found.), gthread gmodule)
960 else
961         #
962         # We have GTK+, and thus will be building Wireshark (if the user
963         # had explicitly disabled Wireshark, we wouldn't have looked for
964         # GTK+, so we wouldn't think we had it, and thus wouldn't be here).
965         #
966         wireshark_bin="wireshark\$(EXEEXT)"
967         wireshark_man="wireshark.1"
968         wireshark_SUBDIRS="codecs ui/gtk"
969         # Don't use GLIB_CFLAGS
970         AM_PATH_GLIB_2_0(2.14.0, , AC_MSG_ERROR(GLib 2.14 or later distribution not found.), gthread gmodule)
971
972         CPPFLAGS="-DGTK_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
973         ## Define GTK_DISABLE_DEPRECATED only if GTK lt 3.2
974         ## GTK 3.2 deprecates GtkVBox & GtkHBox which are currently used extensively by Wireshark.
975         if test $gtk_config_major_version -eq 2 -o $gtk_config_minor_version -lt 2; then
976                 CPPFLAGS="-DGTK_DISABLE_DEPRECATED $CPPFLAGS"
977         fi
978         # CPPFLAGS="-DGDK_DISABLE_DEPRECATED $CPPFLAGS"
979         if test $gtk_config_major_version -eq 2 -a $gtk_config_minor_version -ge 20; then
980                 # Enable GSEAL when building with GTK > 2.20 and < 3.0
981                 # (Versions prior to 2.22 lacked some necessary accessors.)
982                 CPPFLAGS="-DGSEAL_ENABLE $CPPFLAGS"
983         fi
984 fi
985
986 # Error out if a glib header other than a "top level" header
987 #  (glib.h, glib-object.h, gio.h) or certain other headers( e.g.,gmodule.h)
988 #  is used.
989 CPPFLAGS="-DG_DISABLE_SINGLE_INCLUDES $CPPFLAGS"
990
991 # Error out on the usage of deprecated glib functions
992 CPPFLAGS="-DG_DISABLE_DEPRECATED $CPPFLAGS"
993
994 #
995 # Check whether GLib modules are supported, to determine whether we
996 # can support plugins.
997 #
998 AC_MSG_CHECKING(whether GLib supports loadable modules)
999 ac_save_CFLAGS="$CFLAGS"
1000 ac_save_LIBS="$LIBS"
1001 CFLAGS="$CFLAGS $GLIB_CFLAGS"
1002 LIBS="$GLIB_LIBS $LIBS"
1003 AC_TRY_RUN([
1004 #include <glib.h>
1005 #include <gmodule.h>
1006 #include <stdio.h>
1007 #include <stdlib.h>
1008
1009 int
1010 main ()
1011 {
1012   if (g_module_supported())
1013     return 0;   /* success */
1014   else
1015     return 1;   /* failure */
1016 }
1017 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
1018    [echo $ac_n "cross compiling; assumed OK... $ac_c"
1019     ac_cv_glib_supports_modules=yes])
1020 CFLAGS="$ac_save_CFLAGS"
1021 LIBS="$ac_save_LIBS"
1022 if test "$ac_cv_glib_supports_modules" = yes ; then
1023   AC_MSG_RESULT(yes)
1024   have_plugins=yes
1025 else
1026   AC_MSG_RESULT(no)
1027   have_plugins=no
1028 fi
1029
1030 #
1031 # If we have <dlfcn.h>, check whether we can use dladdr to find a
1032 # filename (hopefully, a full pathname, but no guarantees) for
1033 # the executable.
1034 #
1035 if test "$ac_cv_header_dlfcn_h" = "yes"
1036 then
1037         AC_MSG_CHECKING(whether dladdr can be used to find the pathname of an executable)
1038         ac_save_CFLAGS="$CFLAGS"
1039         ac_save_LIBS="$LIBS"
1040         CFLAGS="$CFLAGS $GLIB_CFLAGS"
1041         LIBS="$GLIB_LIBS $LIBS"
1042         AC_TRY_RUN([
1043 #define _GNU_SOURCE     /* required on Linux, sigh */
1044 #include <dlfcn.h>
1045
1046 int
1047 main(void)
1048 {
1049         Dl_info info;
1050
1051         if (!dladdr((void *)main, &info))
1052                 return 1;       /* failure */
1053         return 0;               /* assume success */
1054 }
1055 ], ac_cv_dladdr_finds_executable_path=yes, ac_cv_dladdr_finds_executable_path=no,
1056    [echo $ac_n "cross compiling; assumed OK... $ac_c"
1057     ac_cv_dladdr_finds_executable_path=yes])
1058         CFLAGS="$ac_save_CFLAGS"
1059         LIBS="$ac_save_LIBS"
1060         if test x$ac_cv_dladdr_finds_executable_path = xyes
1061         then
1062                 AC_DEFINE(DLADDR_FINDS_EXECUTABLE_PATH, 1, [Define if dladdr can be used to find the path of the executable])
1063         fi
1064         AC_MSG_RESULT($ac_cv_dladdr_finds_executable_path)
1065 fi
1066
1067 if test "x$have_gtk" = "xyes"
1068 then
1069     #
1070     # We have GTK+; do we want the OS X integration functions and,
1071     # if so, do we have them and, if so, which versions do we have,
1072     # the old Carbon-based ones or the new Cocoa-based ones?
1073     #
1074     AC_MSG_CHECKING(whether to use OS X integration functions)
1075
1076     AC_ARG_WITH(osx-integration,
1077       AC_HELP_STRING( [--with-osx-integration],
1078                       [use OS X integration functions @<:@default=yes, if available@:>@]),
1079     [
1080         if test $withval = no
1081         then
1082             want_osx_integration=no
1083         else
1084             want_osx_integration=yes
1085         fi
1086     ],[
1087         want_osx_integration=yes
1088     ])
1089     if test "x$want_osx_integration" = "xno"; then
1090         AC_MSG_RESULT(no)
1091     else
1092         AC_MSG_RESULT(yes)
1093         AC_WIRESHARK_OSX_INTEGRATION_CHECK
1094     fi
1095 fi
1096
1097 AC_SUBST(wireshark_bin)
1098 AC_SUBST(wireshark_man)
1099
1100
1101 # Enable/disable tshark
1102
1103 AC_ARG_ENABLE(tshark,
1104   AC_HELP_STRING( [--enable-tshark],
1105                   [build TShark @<:@default=yes@:>@]),
1106     tshark=$enableval,enable_tshark=yes)
1107
1108 if test "x$enable_tshark" = "xyes" ; then
1109         tshark_bin="tshark\$(EXEEXT)"
1110         tshark_man="tshark.1"
1111         wiresharkfilter_man="wireshark-filter.4"
1112 else
1113         tshark_bin=""
1114         tshark_man=""
1115 fi
1116 AC_SUBST(tshark_bin)
1117 AC_SUBST(tshark_man)
1118 AC_SUBST(wiresharkfilter_man)
1119
1120
1121
1122 # Enable/disable editcap
1123
1124 AC_ARG_ENABLE(editcap,
1125   AC_HELP_STRING( [--enable-editcap],
1126                   [build editcap @<:@default=yes@:>@]),
1127     enable_editcap=$enableval,enable_editcap=yes)
1128
1129 if test "x$enable_editcap" = "xyes" ; then
1130         editcap_bin="editcap\$(EXEEXT)"
1131         editcap_man="editcap.1"
1132 else
1133         editcap_bin=""
1134         editcap_man=""
1135 fi
1136 AC_SUBST(editcap_bin)
1137 AC_SUBST(editcap_man)
1138
1139 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
1140 # or not)
1141
1142 # Enable/disable capinfos
1143
1144 AC_ARG_ENABLE(capinfos,
1145   AC_HELP_STRING( [--enable-capinfos],
1146                   [build capinfos @<:@default=yes@:>@]),
1147     enable_capinfos=$enableval,enable_capinfos=yes)
1148
1149 if test "x$enable_capinfos" = "xyes" ; then
1150         capinfos_bin="capinfos\$(EXEEXT)"
1151         capinfos_man="capinfos.1"
1152 else
1153         capinfos_bin=""
1154         capinfos_man=""
1155 fi
1156 AC_SUBST(capinfos_bin)
1157 AC_SUBST(capinfos_man)
1158
1159
1160 # Enable/disable mergecap
1161
1162 AC_ARG_ENABLE(mergecap,
1163   AC_HELP_STRING( [--enable-mergecap],
1164                   [build mergecap @<:@default=yes@:>@]),
1165     enable_mergecap=$enableval,enable_mergecap=yes)
1166
1167 if test "x$enable_mergecap" = "xyes" ; then
1168         mergecap_bin="mergecap\$(EXEEXT)"
1169         mergecap_man="mergecap.1"
1170 else
1171         mergecap_bin=""
1172         mergecap_man=""
1173 fi
1174 AC_SUBST(mergecap_bin)
1175 AC_SUBST(mergecap_man)
1176
1177
1178 # Enable/disable reordercap
1179
1180 AC_ARG_ENABLE(reordercap,
1181   AC_HELP_STRING( [--enable-reordercap],
1182                   [build reordercap @<:@default=yes@:>@]),
1183     enable_reordercap=$enableval,enable_reordercap=yes)
1184
1185 if test "x$enable_reordercap" = "xyes" ; then
1186         reordercap_bin="reordercap\$(EXEEXT)"
1187         reordercap_man="reordercap.1"
1188 else
1189         reordercap_bin=""
1190         reordercap_man=""
1191 fi
1192 AC_SUBST(reordercap_bin)
1193 AC_SUBST(reordercap_man)
1194
1195
1196 # Enable/disable text2pcap
1197
1198 AC_ARG_ENABLE(text2pcap,
1199   AC_HELP_STRING( [--enable-text2pcap],
1200                   [build text2pcap @<:@default=yes@:>@]),
1201     text2pcap=$enableval,enable_text2pcap=yes)
1202
1203 if test "x$enable_text2pcap" = "xyes" ; then
1204         text2pcap_bin="text2pcap\$(EXEEXT)"
1205         text2pcap_man="text2pcap.1"
1206 else
1207         text2pcap_bin=""
1208         text2pcap_man=""
1209 fi
1210 AC_SUBST(text2pcap_bin)
1211 AC_SUBST(text2pcap_man)
1212
1213
1214 # Enable/disable dftest
1215
1216 AC_ARG_ENABLE(dftest,
1217   AC_HELP_STRING( [--enable-dftest],
1218                   [build dftest @<:@default=yes@:>@]),
1219     enable_dftest=$enableval,enable_dftest=yes)
1220
1221 if test "x$enable_dftest" = "xyes" ; then
1222         dftest_bin="dftest\$(EXEEXT)"
1223         dftest_man="dftest.1"
1224 else
1225         dftest_bin=""
1226         dftest_man=""
1227 fi
1228 AC_SUBST(dftest_bin)
1229 AC_SUBST(dftest_man)
1230
1231
1232 # Enable/disable randpkt
1233
1234 AC_ARG_ENABLE(randpkt,
1235   AC_HELP_STRING( [--enable-randpkt],
1236                   [build randpkt @<:@default=yes@:>@]),
1237     enable_randpkt=$enableval,enable_randpkt=yes)
1238
1239 if test "x$enable_randpkt" = "xyes" ; then
1240         randpkt_bin="randpkt\$(EXEEXT)"
1241         randpkt_man="randpkt.1"
1242 else
1243         randpkt_bin=""
1244         randpkt_man=""
1245 fi
1246 AC_SUBST(randpkt_bin)
1247 AC_SUBST(randpkt_man)
1248
1249
1250
1251 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
1252 dnl "gethostbyname()".
1253 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
1254
1255 dnl Checks for "connect()", used as a proxy for "socket()" - and
1256 dnl "-lsocket", if we need it to get "connect()".
1257 AC_WIRESHARK_SOCKET_LIB_CHECK
1258
1259 dnl pcap check
1260 AC_MSG_CHECKING(whether to use libpcap for packet capture)
1261
1262 AC_ARG_WITH(pcap,
1263   AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
1264                   [use libpcap for packet capturing @<:@default=yes@:>@]),
1265 [
1266         if test $withval = no
1267         then
1268                 want_pcap=no
1269         elif test $withval = yes
1270         then
1271                 want_pcap=yes
1272         else
1273                 want_pcap=yes
1274                 pcap_dir=$withval
1275         fi
1276 ],[
1277         want_pcap=yes
1278         pcap_dir=
1279 ])
1280 if test "x$want_pcap" = "xno" ; then
1281         AC_MSG_RESULT(no)
1282 else
1283         AC_MSG_RESULT(yes)
1284         AC_WIRESHARK_PCAP_CHECK
1285 fi
1286
1287
1288 dnl Check for airpcap
1289 AC_MSG_CHECKING(whether to include airpcap support)
1290 AC_ARG_ENABLE(airpcap,
1291   AC_HELP_STRING( [--enable-airpcap],
1292                   [use AirPcap in Wireshark @<:@default=yes@:>@]),
1293   enable_airpcap=$enableval, enable_airpcap=yes)
1294
1295 if test x$enable_airpcap = xyes; then
1296         if test "x$want_pcap" = "xno" ; then
1297                 enable_airpcap=no
1298                 AC_MSG_RESULT(pcap not available - disabling airpcap)
1299         else
1300                 AC_MSG_RESULT(yes)
1301                 AC_DEFINE(HAVE_AIRPCAP, 1, [Enable AirPcap])
1302         fi
1303 else
1304         AC_MSG_RESULT(no)
1305 fi
1306
1307
1308 dnl dumpcap check
1309 AC_MSG_CHECKING(whether to build dumpcap)
1310
1311 AC_ARG_ENABLE(dumpcap,
1312   AC_HELP_STRING( [--enable-dumpcap],
1313                   [build dumpcap @<:@default=yes@:>@]),
1314     enable_dumpcap=$enableval,enable_dumpcap=yes)
1315
1316 if test "x$enable_dumpcap" = "xyes" ; then
1317         if test "x$want_pcap" = "xno" ; then
1318                 enable_dumpcap=no
1319                 AC_MSG_RESULT(pcap not available - disabling dumpcap)
1320         else
1321                 AC_MSG_RESULT(yes)
1322         fi
1323 else
1324         AC_MSG_RESULT(no)
1325 fi
1326
1327 if test "x$enable_dumpcap" = "xyes" ; then
1328         dumpcap_bin="dumpcap\$(EXEEXT)"
1329         dumpcap_man="dumpcap.1"
1330 else
1331         dumpcap_bin=""
1332         dumpcap_man=""
1333 fi
1334 AC_SUBST(dumpcap_bin)
1335 AC_SUBST(dumpcap_man)
1336
1337 # Enable/disable rawshark
1338
1339 dnl rawshark check
1340 AC_MSG_CHECKING(whether to build rawshark)
1341
1342 AC_ARG_ENABLE(rawshark,
1343   AC_HELP_STRING( [--enable-rawshark],
1344                   [build rawshark @<:@default=yes@:>@]),
1345     rawshark=$enableval,enable_rawshark=yes)
1346
1347 if test "x$enable_rawshark" = "xyes" ; then
1348         if test "x$want_pcap" = "xno" ; then
1349                 enable_rawshark=no
1350                 AC_MSG_RESULT(pcap not available - disabling rawshark)
1351         else
1352                 AC_MSG_RESULT(yes)
1353         fi
1354 else
1355         AC_MSG_RESULT(no)
1356 fi
1357
1358 if test "x$enable_rawshark" = "xyes" ; then
1359         rawshark_bin="rawshark\$(EXEEXT)"
1360         rawshark_man="rawshark.1"
1361 else
1362         rawshark_bin=""
1363         rawshark_man=""
1364 fi
1365 AC_SUBST(rawshark_bin)
1366 AC_SUBST(rawshark_man)
1367
1368 dnl Use pcap-ng by default
1369 AC_ARG_ENABLE(pcap-ng-default,
1370   AC_HELP_STRING( [--enable-pcap-ng-default],
1371                   [use the pcap-ng file format by default instead of pcap @<:@default=yes@:>@]),
1372     enable_pcap_ng_default=$enableval,enable_pcap_ng_default=yes)
1373 if test x$enable_pcap_ng_default = xyes; then
1374         AC_DEFINE(PCAP_NG_DEFAULT, 1, [Support for pcap-ng])
1375 fi
1376
1377 dnl pcap remote check
1378 AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
1379
1380 AC_ARG_WITH(pcap-remote,
1381     AC_HELP_STRING([--with-pcap-remote],
1382                    [use libpcap remote capturing (requires libpcap)]),
1383 [
1384     if test $withval = no
1385     then
1386         want_pcap_remote=no
1387     else
1388         want_pcap_remote=yes
1389     fi
1390 ],[
1391     want_pcap_remote=no
1392 ])
1393 if test "x$want_pcap_remote" = "xno" -o "x$want_pcap" = "xno" ; then
1394     AC_MSG_RESULT(no)
1395 else
1396     AC_MSG_RESULT(yes)
1397     AC_WIRESHARK_PCAP_REMOTE_CHECK
1398 fi
1399
1400 dnl zlib check
1401 AC_MSG_CHECKING(whether to use zlib for gzip compression and decompression)
1402
1403 AC_ARG_WITH(zlib,
1404   AC_HELP_STRING([--with-zlib@<:@=DIR@:>@],
1405                  [use zlib (located in directory DIR, if supplied) for gzip compression and decompression @<:@default=yes, if available@:>@]),
1406 [
1407         if test "x$withval" = "xno"
1408         then
1409                 want_zlib=no
1410         elif test "x$withval" = "xyes"
1411         then
1412                 want_zlib=yes
1413         else
1414                 want_zlib=yes
1415                 zlib_dir="$withval"
1416         fi
1417 ],[
1418         #
1419         # Use zlib if it's present, otherwise don't.
1420         #
1421         want_zlib=ifavailable
1422         zlib_dir=
1423 ])
1424 if test "x$want_zlib" = "xno" ; then
1425         AC_MSG_RESULT(no)
1426 else
1427         AC_MSG_RESULT(yes)
1428         AC_WIRESHARK_ZLIB_CHECK
1429         if test "x$want_zlib" = "xno" ; then
1430                 AC_MSG_RESULT(zlib not found - disabling gzip compression and decompression)
1431         else
1432                 if test "x$ac_cv_func_inflatePrime" = "xno" ; then
1433                         AC_MSG_RESULT(inflatePrime not found in zlib - disabling gzipped capture file support)
1434                 fi
1435         fi
1436 fi
1437
1438 dnl Lua check
1439 AC_MSG_CHECKING(whether to use liblua for the Lua scripting plugin)
1440
1441 AC_ARG_WITH(lua,
1442   AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
1443                   [use liblua (located in directory DIR, if supplied) for the Lua scripting plugin @<:@default=yes, if available@:>@]),
1444 [
1445         if test $withval = no
1446         then
1447                 want_lua=no
1448         elif test $withval = yes
1449         then
1450                 want_lua=yes
1451         else
1452                 want_lua=yes
1453                 lua_dir=$withval
1454         fi
1455 ],[
1456         #
1457         # Use liblua by default
1458         #
1459         want_lua=ifavailable
1460         lua_dir=
1461 ])
1462 if test "x$want_lua" = "xno" ; then
1463         AC_MSG_RESULT(no)
1464 else
1465         AC_MSG_RESULT(yes)
1466         AC_WIRESHARK_LIBLUA_CHECK
1467         if test "x$want_lua" = "xno" ; then
1468                 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
1469         fi
1470 fi
1471 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
1472
1473
1474 dnl portaudio check
1475 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
1476
1477 AC_ARG_WITH(portaudio,
1478   AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
1479                   [use libportaudio (located in directory DIR, if supplied) for the rtp_player @<:@default=yes, if available@:>@]),
1480 [
1481         if test $withval = no
1482         then
1483                 want_portaudio=no
1484         elif test $withval = yes
1485         then
1486                 want_portaudio=yes
1487         else
1488                 want_portaudio=yes
1489                 portaudio_dir=$withval
1490         fi
1491 ],[
1492         #
1493         # Use libportaudio by default
1494         #
1495         want_portaudio=ifavailable
1496         portaudio_dir=
1497 ])
1498 if test "x$want_portaudio" = "xno" ; then
1499         AC_MSG_RESULT(no)
1500 else
1501         AC_MSG_RESULT(yes)
1502         AC_WIRESHARK_LIBPORTAUDIO_CHECK
1503         if test "x$want_portaudio" = "xno" ; then
1504                 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
1505         fi
1506 fi
1507 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
1508
1509
1510 dnl ipv6 check
1511 AC_ARG_ENABLE(ipv6,
1512   AC_HELP_STRING( [--enable-ipv6],
1513                   [use IPv6 name resolution, if available @<:@default=yes@:>@]),
1514     enable_ipv6=$enableval,enable_ipv6=yes)
1515
1516 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
1517 if test "x$enable_ipv6" = "xno" ; then
1518         AC_MSG_RESULT(no)
1519 else
1520         AC_MSG_RESULT(yes)
1521         AC_WIRESHARK_IPV6_STACK
1522 fi
1523
1524
1525 dnl Check if dumpcap should be installed with filesystem capabilities
1526 AC_PATH_PROG(SETCAP, setcap)
1527 AC_ARG_ENABLE(setcap-install,
1528   AC_HELP_STRING( [--enable-setcap-install],
1529                   [install dumpcap with cap_net_admin and cap_net_raw @<:@default=no@:>@]),
1530     enable_setcap_install=$enableval,enable_setcap_install=no)
1531
1532 AC_MSG_CHECKING(whether to install dumpcap with cap_net_admin and cap_net_raw capabilities)
1533 if test "x$enable_setcap_install" = "xno" ; then
1534         AC_MSG_RESULT(no)
1535 else
1536         if test "x$SETCAP" = "x" ; then
1537                 AC_MSG_RESULT(no. Setcap not found)
1538         elif test "x$enable_dumpcap" = "xno" ; then
1539                 AC_MSG_ERROR(Setcap install works only with dumpcap but dumpcap is disabled)
1540         else
1541                 AC_MSG_RESULT(yes)
1542         fi
1543 fi
1544
1545 AM_CONDITIONAL(SETCAP_INSTALL, test x$enable_setcap_install = xyes)
1546
1547 dnl Check if dumpcap should be installed setuid
1548 AC_ARG_ENABLE(setuid-install,
1549   AC_HELP_STRING( [--enable-setuid-install],
1550                   [install dumpcap as setuid @<:@default=no@:>@]),
1551     enable_setuid_install=$enableval,enable_setuid_install=no)
1552
1553 AC_MSG_CHECKING(whether to install dumpcap setuid)
1554 if test "x$enable_setuid_install" = "xno" ; then
1555         AC_MSG_RESULT(no)
1556 else
1557         if test "x$enable_setcap_install" = "xyes" ; then
1558                 enable_setuid_install=no
1559                 AC_MSG_RESULT(no; using setcap instead)
1560         elif test "x$enable_dumpcap" = "xno" ; then
1561                 AC_MSG_ERROR(Setuid install works only with dumpcap but dumpcap is disabled)
1562         else
1563                 AC_MSG_RESULT(yes)
1564         fi
1565 fi
1566
1567 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
1568 AC_CHECK_FUNCS(setresuid setresgid)
1569
1570 dnl ...but our Network Operations group is named "no"!
1571 DUMPCAP_GROUP=''
1572 AC_ARG_WITH(dumpcap-group,
1573   AC_HELP_STRING( [--with-dumpcap-group=GROUP],
1574                   [restrict dumpcap to GROUP]),
1575 [
1576   if test "x$withval" = "xyes"; then
1577       AC_MSG_ERROR([No dumpcap group specified.])
1578   elif test "x$withval" != "xno"; then
1579       if test "x$enable_dumpcap" = "xno" ; then
1580           AC_MSG_ERROR(dumpcap group install works only with dumpcap but dumpcap is disabled)
1581       fi
1582       AC_MSG_RESULT($withval)
1583       DUMPCAP_GROUP="$withval"
1584   fi
1585 ])
1586 AC_SUBST(DUMPCAP_GROUP)
1587 AM_CONDITIONAL(HAVE_DUMPCAP_GROUP, test x$DUMPCAP_GROUP != x)
1588
1589 dnl libcap (not libpcap) check
1590 LIBCAP_LIBS=''
1591 AC_MSG_CHECKING(whether to use the libcap capabilities library)
1592
1593 AC_ARG_WITH(libcap,
1594   AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
1595                   [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management @<:@default=yes, if present@:>@]),
1596 [
1597 if   test "x$withval" = "xno";  then
1598         want_libcap=no
1599 elif test "x$withval" = "xyes"; then
1600         want_libcap=yes
1601 elif test -d "$withval"; then
1602         want_libcap=yes
1603         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1604 fi
1605 ])
1606 if test "x$with_libcap" = "xno" ; then
1607         AC_MSG_RESULT(no)
1608 else
1609         AC_MSG_RESULT(yes)
1610         AC_WIRESHARK_LIBCAP_CHECK
1611 fi
1612 AC_SUBST(LIBCAP_LIBS)
1613
1614 dnl Checks for header files.
1615 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h grp.h inttypes.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
1616 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)
1617 AC_CHECK_HEADERS(netinet/in.h)
1618 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
1619
1620 dnl SSL Check
1621 SSL_LIBS=''
1622 AC_MSG_CHECKING(whether to use SSL library)
1623
1624 AC_ARG_WITH(ssl,
1625   AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
1626                   [use SSL crypto library (located in directory DIR, if supplied) @<:@default=no@:>@]),
1627 [
1628 if test "x$withval" = "xno";  then
1629         want_ssl=no
1630 elif test "x$withval" = "xyes"; then
1631         want_ssl=yes
1632 elif test -d "$withval"; then
1633         want_ssl=yes
1634         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1635 fi
1636 ],[
1637         want_ssl=no
1638 ])
1639 if test "x$want_ssl" = "xyes"; then
1640         AC_MSG_RESULT(yes)
1641         AC_CHECK_LIB(crypto,EVP_md5,
1642             [
1643                 SSL_LIBS=-lcrypto
1644             ],
1645             [
1646                 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
1647             ])
1648 else
1649         AC_MSG_RESULT(no)
1650 fi
1651 AC_SUBST(SSL_LIBS)
1652
1653 dnl kerberos check
1654 AC_MSG_CHECKING(whether to use Kerberos library)
1655
1656 AC_ARG_WITH(krb5,
1657   AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
1658                   [use Kerberos library (located in directory DIR, if supplied) to use in Kerberos dissection @<:@default=yes@:>@]),
1659 [
1660         if test $withval = no
1661         then
1662                 want_krb5=no
1663         elif test $withval = yes
1664         then
1665                 want_krb5=yes
1666         else
1667                 want_krb5=yes
1668                 krb5_dir=$withval
1669         fi
1670 ],[
1671         #
1672         # Use Kerberos library if available, otherwise don't.
1673         #
1674         want_krb5=ifavailable
1675         krb5_dir=
1676 ])
1677 if test "x$want_krb5" = "xno" ; then
1678         AC_MSG_RESULT(no)
1679 else
1680         AC_MSG_RESULT(yes)
1681         AC_WIRESHARK_KRB5_CHECK
1682 fi
1683
1684
1685 dnl c-ares Check
1686 C_ARES_LIBS=''
1687 AC_MSG_CHECKING(whether to use the c-ares library if available)
1688
1689 AC_ARG_WITH(c-ares,
1690   AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
1691                   [use c-ares (located in directory DIR, if supplied) - supersedes --with-adns @<:@default=yes, if present@:>@]),
1692 [
1693 if   test "x$withval" = "xno";  then
1694         want_c_ares=no
1695 elif test "x$withval" = "xyes"; then
1696         want_c_ares=yes
1697 elif test -d "$withval"; then
1698         want_c_ares=yes
1699         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1700 fi
1701 ])
1702 if test "x$want_c_ares" = "xno" ; then
1703         AC_MSG_RESULT(no)
1704 else
1705         AC_MSG_RESULT(yes)
1706         AC_WIRESHARK_C_ARES_CHECK
1707 fi
1708 AC_SUBST(C_ARES_LIBS)
1709
1710 dnl ADNS Check
1711 ADNS_LIBS=''
1712 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
1713
1714 AC_ARG_WITH(adns,
1715   AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
1716                   [use GNU ADNS (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
1717 [
1718 if   test "x$withval" = "xno";  then
1719         want_adns=no
1720 elif test "x$withval" = "xyes"; then
1721         want_adns=yes
1722 elif test -d "$withval"; then
1723         want_adns=yes
1724         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1725 fi
1726 ])
1727 if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
1728         AC_MSG_RESULT(no)
1729 else
1730         AC_MSG_RESULT(yes)
1731         AC_WIRESHARK_ADNS_CHECK
1732 fi
1733 AC_SUBST(ADNS_LIBS)
1734
1735 dnl GEOIP Check
1736 GEOIP_LIBS=''
1737 AC_MSG_CHECKING(whether to use the GeoIP IP address mapping library if available)
1738
1739 AC_ARG_WITH(geoip,
1740   AC_HELP_STRING( [--with-geoip@<:@=DIR@:>@],
1741                   [use GeoIP (located in directory DIR, if supplied) @<:@default=yes, if present@:>@]),
1742 [
1743 if   test "x$withval" = "xno";  then
1744         want_geoip=no
1745 elif test "x$withval" = "xyes"; then
1746         want_geoip=yes
1747 elif test -d "$withval"; then
1748         want_geoip=yes
1749         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1750 fi
1751 ])
1752 if test "x$want_geoip" = "xno"; then
1753         AC_MSG_RESULT(no)
1754 else
1755         AC_MSG_RESULT(yes)
1756         AC_WIRESHARK_GEOIP_CHECK
1757 fi
1758 AC_SUBST(GEOIP_LIBS)
1759
1760 dnl Python devel Check
1761 AC_MSG_CHECKING(whether to use the Python interpreter for scripting)
1762
1763 AC_ARG_WITH(python,
1764     AC_HELP_STRING( [--with-python@<:@=DIR@:>@],
1765                     [use Python interpreter (installed in DIR, if supplied) @<:@default=no@:>@ (BROKEN/UNSTABLE)]),
1766 [
1767         pythondir='${libdir}/wireshark/python/${VERSION}'
1768         if test "x$withval" = "xno"
1769         then
1770                 want_python=no
1771         elif test "x$withval" = "xyes"
1772         then
1773                 want_python=yes
1774         else
1775                 want_python=yes
1776                 pythondir="$withval"
1777         fi
1778 ],[
1779         # By default (user didn't explicitly enable Python), don't enable
1780         # Python support.
1781         #
1782         want_python=no
1783         #pythondir='${libdir}/wireshark/python/${VERSION}'
1784 ])
1785 if test "x$want_python" = "xno" ; then
1786         AC_MSG_RESULT(no)
1787 else
1788         AC_MSG_RESULT(yes)
1789         AC_WIRESHARK_PYTHON_CHECK
1790 fi
1791 AM_CONDITIONAL(HAVE_LIBPY, test x$want_python != xno)
1792 AC_SUBST(pythondir)
1793
1794 #
1795 # Define WS_VAR_IMPORT appropriately for declarations of external
1796 # variables exported from dynamically-linked libraries.
1797 #
1798 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1799
1800 #
1801 # Define WS_MSVC_NORETURN appropriately for declarations of routines that
1802 # never return (just like Charlie on the MTA).
1803 #
1804 # Note that MSVC++ expects __declspec(noreturn) to precede the function
1805 # name and GCC, as far as I know, expects __attribute__((noreturn)) to
1806 # follow the function name, so we need two different flavors of
1807 # noreturn tag.
1808 #
1809 AC_DEFINE(WS_MSVC_NORETURN,, [Define as the string to precede declarations of routines that never return])
1810
1811 dnl Checks for typedefs, structures, and compiler characteristics.
1812 # AC_C_CONST
1813
1814 # Check how we can get the time zone abbreviation
1815 AC_WIRESHARK_TIMEZONE_ABBREV
1816
1817 # We need to know whether "struct stat" has an "st_flags" member
1818 # for file_user_immutable().
1819
1820 AC_WIRESHARK_STRUCT_ST_FLAGS
1821
1822 # We need to know whether "struct sockaddr" has an "sa_len" member
1823 # for get_interface_list().
1824
1825 AC_WIRESHARK_STRUCT_SA_LEN
1826
1827 # We must know our byte order
1828 AC_C_BIGENDIAN
1829
1830 # Checks whether "-traditional" is needed when using "ioctl".
1831 # XXX - do we need this?
1832 AC_PROG_GCC_TRADITIONAL
1833
1834 GETOPT_LO=""
1835 AC_CHECK_FUNC(getopt,
1836   [GETOPT_LO=""
1837    AC_DEFINE(HAVE_GETOPT, 1, [Define to 1 if you have the getopt function.])
1838   ],
1839   GETOPT_LO="wsgetopt.lo"
1840 )
1841 if test "$ac_cv_func_getopt" = no ; then
1842   GETOPT_LO="wsgetopt.lo"
1843 fi
1844 AM_CONDITIONAL(NEED_GETOPT_LO, test "x$ac_cv_func_getopt" = "xno")
1845 AC_SUBST(GETOPT_LO)
1846
1847 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_LO="",
1848   STRNCASECMP_LO="strncasecmp.lo")
1849 if test "$ac_cv_func_strncasecmp" = no ; then
1850   STRNCASECMP_LO="strncasecmp.lo"
1851 fi
1852 AM_CONDITIONAL(NEED_STRNCASECMP_LO, test "x$ac_cv_func_strncasecmp" = "xno")
1853 AC_SUBST(STRNCASECMP_LO)
1854
1855 AC_CHECK_FUNCS(mkstemp mkdtemp)
1856
1857 AC_SEARCH_LIBS(inet_aton, [socket nsl], have_inet_aton=yes,
1858     have_inet_aton=no)
1859 if test "$have_inet_aton" = no; then
1860   INET_ATON_LO="inet_aton.lo"
1861   AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1862 else
1863   INET_ATON_LO=""
1864 fi
1865 AM_CONDITIONAL(NEED_INET_ATON_LO, test "x$have_inet_aton" = "xno")
1866 AC_SUBST(INET_ATON_LO)
1867
1868 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1869   dnl check for pre-BIND82 inet_pton() bug.
1870   AC_MSG_CHECKING(for broken inet_pton)
1871   AC_TRY_RUN([#include <sys/types.h>
1872 #include <sys/socket.h>
1873 #include <netinet/in.h>
1874 #include <arpa/inet.h>
1875 int main()
1876 {
1877 #ifdef AF_INET6
1878   char buf[16];
1879   /* this should return 0 (error) */
1880   return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1881 #else
1882   return 1;
1883 #endif
1884 }], [AC_MSG_RESULT(ok);
1885 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1886 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1887 have_inet_pton=no])],
1888 have_inet_pton=no)
1889 if test "$have_inet_pton" = no; then
1890   INET_PTON_LO="inet_pton.lo"
1891 else
1892   INET_PTON_LO=""
1893 fi
1894 AM_CONDITIONAL(NEED_INET_PTON_LO, test "x$have_inet_pton" = "xno")
1895 AC_SUBST(INET_PTON_LO)
1896
1897 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1898   AC_MSG_CHECKING([for inet_ntop prototype])
1899   AC_TRY_COMPILE([#include <stdio.h>
1900 #include <sys/types.h>
1901 #include <sys/socket.h>
1902 #include <netinet/in.h>
1903 #include <arpa/inet.h>
1904
1905 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1906     AC_MSG_RESULT(yes)
1907     AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1908     [Define if inet_ntop() prototype exists])], [
1909     AC_TRY_COMPILE([#include <stdio.h>
1910 #include <sys/types.h>
1911 #include <sys/socket.h>
1912 #include <netinet/in.h>
1913 #include <arpa/inet.h>
1914
1915 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1916       AC_MSG_RESULT(yes)
1917       AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1918       [Define if inet_ntop() prototype exists])], [
1919       AC_MSG_RESULT(no)])])
1920   INET_NTOP_LO=""], [
1921   INET_NTOP_LO="inet_ntop.lo"
1922   AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1923   [Define if inet/v6defs.h needs to be included])])
1924 AM_CONDITIONAL(NEED_INET_NTOP_LO, test "x$INET_NTOP_LO" != "x")
1925 AC_SUBST(INET_NTOP_LO)
1926
1927 AC_CHECK_FUNC(strptime, STRPTIME_LO="",
1928   [STRPTIME_LO="strptime.lo"
1929    AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1930 ])
1931 if test "$ac_cv_func_strptime" = no ; then
1932   STRPTIME_LO="strptime.lo"
1933 fi
1934 AC_SUBST(STRPTIME_C)
1935 AM_CONDITIONAL(NEED_STRPTIME_LO, test "x$ac_cv_func_strptime" = "no")
1936 AC_SUBST(STRPTIME_LO)
1937
1938 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1939 AC_CHECK_FUNCS(issetugid)
1940 AC_CHECK_FUNCS(mmap mprotect sysconf)
1941 AC_CHECK_FUNCS(strtoll)
1942
1943 dnl blank for now, but will be used in future
1944 AC_SUBST(wireshark_SUBDIRS)
1945
1946 dnl
1947 dnl check whether plugins should be enabled and, if they should be,
1948 dnl check for plugins directory - stolen from Amanda's configure.ac
1949 dnl
1950 dnl we don't wish to expand ${libdir} yet
1951 plugindir='${libdir}/wireshark/plugins/${VERSION}'
1952 AC_ARG_WITH(plugins,
1953   AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
1954                   [support plugins (installed in DIR, if supplied) @<:@default=yes, if possible@:>@]),
1955 [
1956   if test "x$withval" = "xno"; then
1957     have_plugins=no
1958   elif test "x$have_plugins" = "xno"; then
1959       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1960   elif test "x$withval" != "xyes"; then
1961       plugindir="$withval"
1962   fi
1963 ])
1964 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
1965 if test x$have_plugins = xyes
1966 then
1967   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1968 fi
1969 AC_SUBST(plugindir)
1970 CPPFLAGS="$CPPFLAGS '-DPLUGIN_DIR=\"\$(plugindir)\"'"
1971
1972 #
1973 # The plugin dissectors reside in ./plugins/PROTO/
1974 #
1975 PLUGIN_LIBS=""
1976 AC_SUBST(PLUGIN_LIBS)
1977
1978 #
1979 # Check if (emem) memory allocations must be 8-byte aligned.
1980 # I haven't been able to write C code that reliably makes that determination
1981 # (different versions of GCC with or without optimization give different
1982 # results) so just assume everything except (32-bit) x86 needs 8-byte
1983 # alignment (64-bit x86 will get 8-byte alignment from G_MEM_ALIGN anyway).
1984 #
1985 AC_MSG_CHECKING(whether we need memory allocations to be 8-byte aligned)
1986 if test x$host_cpu != xi386
1987 then
1988   AC_MSG_RESULT(yes)
1989   AC_DEFINE(NEED_8_BYTE_ALIGNMENT, 1, [Define if we need memory allocations to be 8-byte aligned])
1990 else
1991   AC_MSG_RESULT(no)
1992 fi
1993
1994 dnl libtool defs
1995 #
1996 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1997 # (autoconf?  automake?  libtool?) - with the newer version(s), it's
1998 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1999 #
2000 # With older version(s) of those tool(s), however, it's not just an
2001 # alias, and the configure scripts don't work without it.
2002 #
2003 AM_PROG_LIBTOOL
2004 AC_SUBST(LIBTOOL_DEPS)
2005
2006 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
2007 if test x$enable_static = xyes -a x$have_plugins = xyes
2008 then
2009   AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
2010 fi
2011 AC_SUBST(ENABLE_STATIC)
2012
2013 dnl Save the cacheable configure results to config.cache before recursing
2014 AC_CACHE_SAVE
2015
2016 sinclude(plugins/Custom.m4) dnl
2017 ifdef(_CUSTOM_AC_OUTPUT_,, define(_CUSTOM_AC_OUTPUT_, )) dnl
2018
2019 sinclude(asn1/Custom.m4) dnl
2020 ifdef(_CUSTOM_ASN1_AC_OUTPUT_,, define(_CUSTOM_ASN1_AC_OUTPUT_, )) dnl
2021
2022 AM_CONFIG_HEADER(config.h)
2023 AC_OUTPUT(
2024   Makefile
2025   doxygen.cfg
2026   asn1/Makefile
2027   _CUSTOM_ASN1_AC_OUTPUT_
2028   asn1/acp133/Makefile
2029   asn1/acse/Makefile
2030   asn1/ansi_map/Makefile
2031   asn1/ansi_tcap/Makefile
2032   asn1/c1222/Makefile
2033   asn1/camel/Makefile
2034   asn1/cdt/Makefile
2035   asn1/charging_ase/Makefile
2036   asn1/cmip/Makefile
2037   asn1/cmp/Makefile
2038   asn1/crmf/Makefile
2039   asn1/cms/Makefile
2040   asn1/credssp/Makefile
2041   asn1/dap/Makefile
2042   asn1/disp/Makefile
2043   asn1/dop/Makefile
2044   asn1/dsp/Makefile
2045   asn1/ess/Makefile
2046   asn1/ftam/Makefile
2047   asn1/gnm/Makefile
2048   asn1/goose/Makefile
2049   asn1/gprscdr/Makefile
2050   asn1/gsm_map/Makefile
2051   asn1/h225/Makefile
2052   asn1/h235/Makefile
2053   asn1/h245/Makefile
2054   asn1/h248/Makefile
2055   asn1/h282/Makefile
2056   asn1/h283/Makefile
2057   asn1/h323/Makefile
2058   asn1/h450/Makefile
2059   asn1/h450-ros/Makefile
2060   asn1/h460/Makefile
2061   asn1/h501/Makefile
2062   asn1/HI2Operations/Makefile
2063   asn1/hnbap/Makefile
2064   asn1/idmp/Makefile
2065   asn1/inap/Makefile
2066   asn1/kerberos/Makefile
2067   asn1/lcsap/Makefile
2068   asn1/ldap/Makefile
2069   asn1/logotypecertextn/Makefile
2070   asn1/lpp/Makefile
2071   asn1/lppa/Makefile
2072   asn1/lppe/Makefile
2073   asn1/lte-rrc/Makefile
2074   asn1/m3ap/Makefile
2075   asn1/mms/Makefile
2076   asn1/mpeg-audio/Makefile
2077   asn1/mpeg-pes/Makefile
2078   asn1/nbap/Makefile
2079   asn1/ns_cert_exts/Makefile
2080   asn1/ocsp/Makefile
2081   asn1/p1/Makefile
2082   asn1/p22/Makefile
2083   asn1/p7/Makefile
2084   asn1/p772/Makefile
2085   asn1/pcap/Makefile
2086   asn1/pkcs1/Makefile
2087   asn1/pkcs12/Makefile
2088   asn1/pkinit/Makefile
2089   asn1/pkixac/Makefile
2090   asn1/pkix1explicit/Makefile
2091   asn1/pkix1implicit/Makefile
2092   asn1/pkixproxy/Makefile
2093   asn1/pkixqualified/Makefile
2094   asn1/pkixtsp/Makefile
2095   asn1/pres/Makefile
2096   asn1/q932/Makefile
2097   asn1/q932-ros/Makefile
2098   asn1/qsig/Makefile
2099   asn1/ranap/Makefile
2100   asn1/rnsap/Makefile
2101   asn1/ros/Makefile
2102   asn1/rrc/Makefile
2103   asn1/rrlp/Makefile
2104   asn1/rtse/Makefile
2105   asn1/rua/Makefile
2106   asn1/s1ap/Makefile
2107   asn1/sabp/Makefile
2108   asn1/sbc-ap/Makefile
2109   asn1/smrse/Makefile
2110   asn1/snmp/Makefile
2111   asn1/spnego/Makefile
2112   asn1/sv/Makefile
2113   asn1/t124/Makefile
2114   asn1/t125/Makefile
2115   asn1/t38/Makefile
2116   asn1/tcap/Makefile
2117   asn1/tetra/Makefile
2118   asn1/ulp/Makefile
2119   asn1/wlancertextn/Makefile
2120   asn1/x2ap/Makefile
2121   asn1/x509af/Makefile
2122   asn1/x509ce/Makefile
2123   asn1/x509if/Makefile
2124   asn1/x509sat/Makefile
2125   asn1/x721/Makefile
2126   doc/Makefile
2127   docbook/Makefile
2128   epan/Makefile
2129   epan/crypt/Makefile
2130   epan/doxygen.cfg
2131   epan/dfilter/Makefile
2132   epan/dissectors/Makefile
2133   epan/dissectors/dcerpc/Makefile
2134   epan/dissectors/pidl/Makefile
2135   epan/ftypes/Makefile
2136   epan/wslua/Makefile
2137   epan/wspython/Makefile
2138   codecs/Makefile
2139   ui/Makefile
2140   ui/doxygen.cfg
2141   ui/gtk/Makefile
2142   ui/gtk/doxygen.cfg
2143   ui/cli/Makefile
2144   ui/qt/Makefile
2145   ui/qt/doxygen.cfg
2146   help/Makefile
2147   packaging/Makefile
2148   packaging/macosx/Info.plist
2149   packaging/macosx/Makefile
2150   packaging/macosx/osx-dmg.sh
2151   packaging/nsis/Makefile
2152   packaging/rpm/Makefile
2153   packaging/rpm/SPECS/Makefile
2154   packaging/rpm/SPECS/wireshark.spec
2155   packaging/svr4/Makefile
2156   packaging/svr4/checkinstall
2157   packaging/svr4/pkginfo
2158   plugins/Makefile
2159   plugins/asn1/Makefile
2160   plugins/docsis/Makefile
2161   plugins/ethercat/Makefile
2162   plugins/gryphon/Makefile
2163   plugins/irda/Makefile
2164   plugins/m2m/Makefile
2165   plugins/mate/Makefile
2166   plugins/opcua/Makefile
2167   plugins/profinet/Makefile
2168   plugins/stats_tree/Makefile
2169   plugins/unistim/Makefile
2170   plugins/wimax/Makefile
2171   plugins/wimaxasncp/Makefile
2172   plugins/wimaxmacphy/Makefile
2173   tools/Makefile
2174   tools/lemon/Makefile
2175   wiretap/Makefile
2176   wsutil/Makefile
2177   _CUSTOM_AC_OUTPUT_
2178   ,)
2179 dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
2180
2181
2182 # Pretty messages
2183
2184 if test "x$have_qt" = "xyes"; then
2185         gui_lib_message=" (with Qt)"
2186 else
2187         if test "x$have_gtk" = "xyes"; then
2188                 if test "x$with_gtk3" = "xyes"; then
2189                         gui_lib_message=" (with GTK+ 3"
2190                 else
2191                         gui_lib_message=" (with GTK+ 2"
2192                 fi
2193                 if test "x$have_ige_mac" = "xyes"; then
2194                         gui_lib_message="$gui_lib_message and Mac OS X integration)"
2195                 else
2196                         gui_lib_message="$gui_lib_message)"
2197                 fi
2198         fi
2199 fi
2200
2201 if test "x$enable_setcap_install" = "xyes" ; then
2202         setcap_message="yes"
2203 else
2204         setcap_message="no"
2205 fi
2206
2207 if test "x$enable_setuid_install" = "xyes" ; then
2208         setuid_message="yes"
2209 else
2210         setuid_message="no"
2211 fi
2212
2213 if test "x$DUMPCAP_GROUP" = "x" ; then
2214         dumpcap_group_message="(none)"
2215 else
2216         dumpcap_group_message="$DUMPCAP_GROUP"
2217 fi
2218
2219 if test "x$want_zlib" = "xno" ; then
2220         zlib_message="no"
2221 else
2222         zlib_message="yes"
2223 fi
2224
2225 if test "x$want_lua" = "xyes" ; then
2226         lua_message="yes"
2227 else
2228         lua_message="no"
2229 fi
2230
2231 if test "x$want_python" = "xno"; then
2232         python_message="no"
2233 else
2234         python_message="yes"
2235 fi
2236
2237 if test "x$want_portaudio" = "xyes" ; then
2238         portaudio_message="yes"
2239 else
2240         portaudio_message="no"
2241 fi
2242
2243 if test "x$want_ssl" = "xno" ; then
2244         ssl_message="no"
2245 else
2246         ssl_message="yes"
2247 fi
2248
2249 if test "x$want_krb5" = "xno" ; then
2250         krb5_message="no"
2251 else
2252         krb5_message="yes ($ac_krb5_version)"
2253 fi
2254
2255 if test "x$have_good_c_ares" = "xyes" ; then
2256         c_ares_message="yes"
2257 else
2258         c_ares_message="no"
2259 fi
2260
2261 if test "x$have_good_adns" = "xyes" ; then
2262         adns_message="yes"
2263 else
2264         if test "x$have_good_c_ares" = "xyes" ; then
2265                 adns_message="no (using c-ares instead)"
2266         else
2267                 adns_message="no"
2268         fi
2269 fi
2270
2271 if test "x$have_good_libcap" = "xyes" ; then
2272         libcap_message="yes"
2273 else
2274         libcap_message="no"
2275 fi
2276
2277 if test "x$have_good_geoip" = "xyes" ; then
2278         geoip_message="yes"
2279 else
2280         geoip_message="no"
2281 fi
2282
2283 echo ""
2284 echo "The Wireshark package has been configured with the following options."
2285 echo "                    Build wireshark : $enable_wireshark""$gui_lib_message"
2286 echo "                       Build tshark : $enable_tshark"
2287 echo "                     Build capinfos : $enable_capinfos"
2288 echo "                      Build editcap : $enable_editcap"
2289 echo "                      Build dumpcap : $enable_dumpcap"
2290 echo "                     Build mergecap : $enable_mergecap"
2291 echo "                   Build reordercap : $enable_reordercap"
2292 echo "                    Build text2pcap : $enable_text2pcap"
2293 echo "                      Build randpkt : $enable_randpkt"
2294 echo "                       Build dftest : $enable_dftest"
2295 echo "                     Build rawshark : $enable_rawshark"
2296 echo ""
2297 echo "   Save files as pcap-ng by default : $enable_pcap_ng_default"
2298 echo "  Install dumpcap with capabilities : $setcap_message"
2299 echo "             Install dumpcap setuid : $setuid_message"
2300 echo "                  Use dumpcap group : $dumpcap_group_message"
2301 echo "                        Use plugins : $have_plugins"
2302 echo "                    Use Lua library : $lua_message"
2303 echo "                 Use Python binding : $python_message"
2304 echo "                   Build rtp_player : $portaudio_message"
2305 echo "             Build profile binaries : $enable_profile_build"
2306 echo "                   Use pcap library : $want_pcap"
2307 echo "                   Use zlib library : $zlib_message"
2308 echo "               Use kerberos library : $krb5_message"
2309 echo "                 Use c-ares library : $c_ares_message"
2310 echo "               Use GNU ADNS library : $adns_message"
2311 echo "                Use SMI MIB library : $libsmi_message"
2312 echo "             Use GNU crypto library : $gcrypt_message"
2313 echo "             Use SSL crypto library : $ssl_message"
2314 echo "           Use IPv6 name resolution : $enable_ipv6"
2315 echo "                 Use gnutls library : $tls_message"
2316 echo "     Use POSIX capabilities library : $libcap_message"
2317 echo "                  Use GeoIP library : $geoip_message"
2318 echo "                     Use nl library : $libnl_message"