Some packet_list.h -> main_packet_list.h changes.
[obnox/wireshark/wip.git] / configure.in
1 # $Id$
2 #
3 AC_INIT(cfile.h)
4
5 AC_PREREQ(2.52)
6
7 dnl Check for CPU / vendor / OS
8 dnl The user is encouraged to use either `AC_CANONICAL_BUILD', or
9 dnl `AC_CANONICAL_HOST', or `AC_CANONICAL_TARGET', depending on the
10 dnl needs.  Using `AC_CANONICAL_TARGET' is enough to run the two other
11 dnl macros.
12
13 dnl AC_CANONICAL_HOST
14 dnl AC_CANONICAL_BUILD
15 AC_CANONICAL_TARGET
16
17 AM_INIT_AUTOMAKE(wireshark, 1.0.99)
18
19 AM_DISABLE_STATIC
20
21 dnl Checks for programs.
22 AC_PROG_CC
23 AC_PROG_CPP
24 dnl Work around libtool bug (fixed in the version 1.5a?)
25 AC_DEFUN([AC_PROVIDE_AC_LIBTOOL_DLOPEN], )
26 AC_LIBTOOL_DLOPEN
27 AC_PROG_LIBTOOL
28 AC_PATH_PROG(PERL, perl)
29 AC_PROG_YACC
30 AC_PATH_PROG(YACCDUMMY, $YACC)
31 if test "x$YACCDUMMY" = x
32 then
33         AC_MSG_ERROR(I couldn't find yacc (or bison or ...); make sure it's installed and in your path)
34 fi
35 AM_PROG_LEX
36 AC_PATH_PROG(LEXDUMMY, $LEX)
37 if test "x$LEXDUMMY" = x
38 then
39         AC_MSG_ERROR(I couldn't find (f)lex; make sure it's installed and in your path)
40 fi
41 AC_PATH_PROG(POD2MAN, pod2man)
42 if test "x$POD2MAN" = x
43 then
44         #
45         # The alternative is not to build the man pages....
46         #
47         AC_MSG_ERROR(I couldn't find pod2man; make sure it's installed and in your path)
48 fi
49 AC_PATH_PROG(POD2HTML, pod2html)
50 if test "x$POD2HTML" = x
51 then
52         #
53         # The alternative is not to build the HTML man pages....
54         #
55         AC_MSG_ERROR(I couldn't find pod2html; make sure it's installed and in your path)
56 fi
57 AC_PATH_PROG(HTML_VIEWER, xdg-open)
58 if test "x$HTML_VIEWER" = x
59 then
60         AC_PATH_PROG(HTML_VIEWER, htmlview)
61         if test "x$HTML_VIEWER" = x
62         then
63                 AC_DEFINE_UNQUOTED(HTML_VIEWER, "mozilla", [HTML viewer, e.g. mozilla])
64         else
65                 AC_DEFINE_UNQUOTED(HTML_VIEWER, "htmlview", [HTML viewer, e.g. mozilla])
66         fi
67 else
68         AC_DEFINE_UNQUOTED(HTML_VIEWER, "xdg-open", [HTML viewer, e.g. mozilla])
69 fi
70
71 AC_PATH_PROG(LEX, flex)
72 AC_PATH_PROG(PYTHON, python)
73
74 AC_SUBST(PERL)
75 AC_SUBST(POD2MAN)
76 AC_SUBST(POD2HTML)
77 AC_SUBST(LEX)
78 AC_SUBST(FLEX_PATH)
79 AC_SUBST(PYTHON)
80 AC_SUBST(XSLTPROC)
81 AC_SUBST(XMLLINT)
82
83 if test "x$CC_FOR_BUILD" = x
84 then
85        CC_FOR_BUILD=$CC
86 fi
87 AC_SUBST(CC_FOR_BUILD)
88
89 # Check for doxygen
90 AC_PATH_PROG(DOXYGEN, doxygen)
91 AC_CHECK_PROG(HAVE_DOXYGEN, doxygen, "yes", "no")
92 AM_CONDITIONAL(HAVE_DOXYGEN, test x$HAVE_DOXYGEN = xyes)
93
94 # gnu tls
95 tls_message="no"
96 AC_ARG_WITH([gnutls],
97   AC_HELP_STRING( [--with-gnutls=@<:@yes/no@:>@],
98                   [use gnutls library @<:@default=yes@:>@]),
99   with_gnutls="$withval", with_gnutls="yes")
100 if test "x$with_gnutls" = "xyes"; then
101   AM_PATH_LIBGNUTLS(1.2.0,
102         [
103                 echo "gnuTLS found, enabling ssl decryption"
104                 AC_DEFINE(HAVE_LIBGNUTLS, 1, [Define to use gnutls library])
105                 tls_message="yes"
106         ]
107         , [
108                 if test x$libgnutls_config_prefix != x ; then
109                         AC_MSG_ERROR([[gnuTLS not found; install gnuTLS-devel package for your system]])
110                 else
111                         echo echo "gnuTLS not found, disabling ssl decryption"
112                         tls_message="no"
113                 fi
114         ]
115   )
116 fi
117
118 # libgrypt
119 gcrypt_message="no"
120 AC_ARG_WITH([gcrypt],
121   AC_HELP_STRING( [--with-gcrypt=@<:@yes/no@:>@],
122                   [use gcrypt library @<:@default=yes@:>@]),
123   with_gcrypt="$withval", with_gcrypt="yes")
124 if test "x$with_gcrypt" = "xyes"; then
125   AM_PATH_LIBGCRYPT(1.1.42,
126         [
127                 echo "libgcrypt found, enabling ipsec decryption"
128                 AC_DEFINE(HAVE_LIBGCRYPT, 1, [Define to use libgcrypt])
129                 gcrypt_message="yes"
130         ]
131         , [
132                 if test x$libgcrypt_config_prefix != x ; then
133                         AC_MSG_ERROR([[libgcrypt not found; install libgcrypt-devel package for your system]])
134                 else
135                         echo "libgcrypt not found, disabling ipsec decryption"
136                         gcrypt_message="no"
137                 fi
138         ]
139   )
140 fi
141
142 # libsmi
143 # FIXME: currently the path argument to with-libsmi is being ignored
144 AX_LIBSMI
145
146 # Check for xsltproc
147 AC_PATH_PROG(XSLTPROC, xsltproc)
148 AC_CHECK_PROG(HAVE_XSLTPROC, xsltproc, "yes", "no")
149 AM_CONDITIONAL(HAVE_XSLTPROC, test x$HAVE_XSLTPROC = xyes)
150
151 # Check for xmllint
152 AC_PATH_PROG(XMLLINT, xmllint)
153 AC_CHECK_PROG(HAVE_XMLLINT, xmllint, "yes", "no")
154 AM_CONDITIONAL(HAVE_XMLLINT, test x$HAVE_XMLLINT = xyes)
155
156 # Check for fop (translate .fo to e.g. pdf)
157 AC_PATH_PROG(FOP, fop)
158 AC_CHECK_PROG(HAVE_FOP, fop, "yes", "no")
159 AM_CONDITIONAL(HAVE_FOP, test x$HAVE_FOP = xyes)
160
161 # Check for hhc (html help compiler)
162 AC_PATH_PROG(HHC, hhc.exe)
163 AC_CHECK_PROG(HAVE_HHC, hhc.exe, "yes", "no")
164 AM_CONDITIONAL(HAVE_HHC, test x$HAVE_HHC = xyes)
165
166 # Check for packaging utilities
167 # For now, we check to see if the various packaging utilites are in our
168 # path.  I'm too lazy to write code to go hunt for them.  -  Gerald
169
170 # SVR4/Solaris
171 AC_CHECK_PROG(HAVE_PKGPROTO, pkgproto, "yes", "no")
172 AC_CHECK_PROG(HAVE_PKGMK, pkgmk, "yes", "no")
173 AC_CHECK_PROG(HAVE_PKGTRANS, pkgtrans, "yes", "no")
174
175 if test x$HAVE_PKGPROTO = xyes -a x$HAVE_PKGMK = xyes \
176      -a x$HAVE_PKGTRANS = xyes ; then
177   HAVE_SVR4_PACKAGING=yes
178 else
179   HAVE_SVR4_PACKAGING=no
180 fi
181 AC_SUBST(HAVE_SVR4_PACKAGING)
182
183 # RPM
184 AC_WIRESHARK_RPM_CHECK
185 AC_SUBST(HAVE_RPM)
186
187 # Debian
188 AC_CHECK_PROG(HAVE_DPKG_BUILDPACKAGE, dpkg-buildpackage, "yes", "no")
189
190 # Mac OS X
191 AC_CHECK_PROG(HAVE_XCODEBUILD, xcodebuild, "yes", "no")
192 AC_CHECK_PROG(HAVE_HDIUTIL, hdiutil, "yes", "no")
193 AC_CHECK_PROG(HAVE_BLESS, bless, "yes", "no")
194
195 if test x$HAVE_XCODEBUILD = xyes -a x$HAVE_HDIUTIL = xyes \
196      -a x$HAVE_BLESS = xyes ; then
197   HAVE_OSX_PACKAGING=yes
198 else
199   HAVE_OSX_PACKAGING=no
200 fi
201 AC_SUBST(HAVE_OSX_PACKAGING)
202
203 #
204 # Try to add some additional gcc checks to CFLAGS
205 #
206 AC_ARG_ENABLE(extra-gcc-checks,
207   AC_HELP_STRING( [--enable-extra-gcc-checks],
208                   [Do additional -W checks in GCC.  @<:@default=no@:>@]),
209 [
210         wireshark_extra_gcc_flags=$enableval
211         if test $enableval != no
212         then
213                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-pedantic)
214                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Woverflow)
215                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-long-long)
216                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wbad-function-cast)
217                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-qual)
218                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
219                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wwrite-strings)
220                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wshorten-64-to-32)
221                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wstrict-prototypes)
222                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wmissing-declarations)
223                 #Temporarily put cast-align here waiting eradication of 'cast
224                 #increases required alignment of target type' on the Solaris
225                 #slave.
226                 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wcast-align)
227         fi
228 ],)
229 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wall -W)
230 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wdeclaration-after-statement)
231 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wendif-labels)
232 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wpointer-arith)
233 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Wno-pointer-sign)
234 AC_WIRESHARK_GCC_CFLAGS_CHECK(-Warray-bounds)
235
236 #
237 # If we're running gcc add '-D_U_="__attribute__((unused))"' to CFLAGS as well,
238 # so we can use _U_ to flag unused function arguments and not get warnings
239 # about them. Otherwise, add '-D_U_=""', so that _U_ used to flag an unused
240 # function argument will compile with non-GCC compilers.
241 #
242 if test "x$GCC" = "xyes" ; then
243   CFLAGS="-D_U_=\"__attribute__((unused))\" $CFLAGS"
244 else
245   CFLAGS="-D_U_=\"\" $CFLAGS"
246 fi
247
248 #
249 # If we're running gcc, will enable a barrier "stop on warning".
250 # This barrier is set for a very large part of the code. However, it is
251 # typically not set for "generated" code  (lex, ans2wrs, idl2wrs, ...)
252 #
253 warnings_as_errors_default="yes"
254 AC_MSG_CHECKING(whether we should treat compiler warnings as errors)
255 AC_ARG_ENABLE(warnings-as-errors,
256   AC_HELP_STRING( [--enable-warnings-as-errors],
257                   [Treat warnings as errors (only for gcc). @<:@default=yes@:>@]),
258 [
259   if test "x$GCC" = "xyes" -a "x$enableval" == "xyes" -a "x$wireshark_extra_gcc_flags" != "xyes"; then
260     with_warnings_as_errors="yes"
261     AC_MSG_RESULT(yes)
262   else
263     with_warnings_as_errors="no"
264     AC_MSG_RESULT(no)
265   fi
266 ],
267   if test "x$GCC" = "xyes" -a "x$wireshark_extra_gcc_flags" = "x" -a "x$warnings_as_errors_default" = "xyes"; then
268     with_warnings_as_errors="yes"
269     AC_MSG_RESULT(yes)
270   else
271     with_warnings_as_errors="no"
272     AC_MSG_RESULT(no)
273   fi
274 )
275 AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
276
277 #
278 # Add any platform-specific compiler flags needed.
279 #
280 AC_MSG_CHECKING(for platform-specific compiler flags)
281 if test "x$GCC" = "xyes" ; then
282         #
283         # GCC - do any platform-specific tweaking necessary.
284         #
285         case "$host_os" in
286         solaris*)
287                 # the X11 headers don't automatically include prototype info
288                 # and a lot don't include the return type
289                 CFLAGS="$CFLAGS -Wno-return-type -DFUNCPROTO=15"
290                 AC_MSG_RESULT(GCC on Solaris - added -Wno-return-type -DFUNCPROTO=15)
291                 ;;
292         darwin*)
293                 #
294                 # See comments above about Apple's lovely C compiler.
295                 #
296                 CFLAGS="-no-cpp-precomp $CFLAGS"
297                 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
298                 ;;
299         *)
300                 AC_MSG_RESULT(none needed)
301                 ;;
302         esac
303 else
304         #
305         # Not GCC - assume it's the vendor's compiler.
306         #
307         case "$host_os" in
308         hpux*)
309                 #
310                 # HP's ANSI C compiler; flags suggested by Jost Martin.
311                 # "-Ae" for ANSI C plus extensions such as "long long".
312                 # "+O2", for optimization.  XXX - works with "-g"?
313                 #
314                 CFLAGS="-Ae +O2 $CFLAGS"
315                 AC_MSG_RESULT(HP ANSI C compiler - added -Ae +O2)
316                 ;;
317         darwin*)
318                 #
319                 # It may be called "cc", but it's really a GCC derivative
320                 # with a problematic special precompiler and precompiled
321                 # headers; turn off the special precompiler, as some
322                 # apparently-legal code won't compile with its precompiled
323                 # headers.
324                 #
325                 CFLAGS="-no-cpp-precomp $CFLAGS"
326                 AC_MSG_RESULT(Apple GCC - added -no-cpp-precomp)
327                 ;;
328         *)
329                 AC_MSG_RESULT(none needed)
330                 ;;
331         esac
332 fi
333
334 #
335 # Add any platform-specific linker flags needed.
336 #
337 AC_MSG_CHECKING(for platform-specific linker flags)
338 case "$host_os" in
339 darwin*)
340         #
341         # Add -Wl,-single_module to the LDFLAGS used with shared
342         # libraries, to fix some error that show up in some cases;
343         # some Apple documentation recommends it for most shared
344         # libraries.
345         #
346         LDFLAGS_SHAREDLIB="-Wl,-single_module"
347         #
348         # Add -Wl,-search_paths_first to make sure that if we search
349         # directories A and B, in that order, for a given library, a
350         # non-shared version in directory A, rather than a shared
351         # version in directory B, is chosen (so we can use
352         # --with-pcap=/usr/local to force all programs to be linked
353         # with a static version installed in /usr/local/lib rather than
354         # the system version in /usr/lib).
355         #
356         LDFLAGS="-Wl,-search_paths_first $LDFLAGS"
357         AC_MSG_RESULT([Apple linker - added -Wl,-single_module and -Wl,-search_paths_first])
358         ;;
359 cygwin*)
360         #
361         # Shared libraries in cygwin/Win32 must never contain
362         # undefined symbols.
363         #
364         LDFLAGS="$LDFLAGS -no-undefined"
365         AC_MSG_RESULT(CygWin GNU ld - added -no-undefined)
366         ;;
367 *)
368         AC_MSG_RESULT(none needed)
369         ;;
370 esac
371 AC_SUBST(LDFLAGS_SHAREDLIB)
372
373 #
374 # On OS X, if we find the headers for Core Foundation, Launch Services,
375 # and Core Services, add -framework options to link with Application
376 # Services (of which Launch Services is a subframework), Core Foundation
377 # (required by the Launch Services APIs), and Core Services, so we can
378 # use them to launch a Web browser from the Help menu and to use
379 # Gestalt() to get the Mac OS X version number.
380 #
381 case "$host_os" in
382
383 darwin*)
384         AC_MSG_CHECKING([whether we can build with Core Foundation, Launch Services, and Core Services])
385         ac_save_LIBS="$LIBS"
386         ac_frameworks="-framework ApplicationServices -framework CoreFoundation -framework CoreServices"
387         LIBS="$LIBS $ac_frameworks"
388         AC_TRY_LINK(
389            [
390 #       include <CoreFoundation/CFBase.h>
391 #       include <CoreFoundation/CFString.h>
392 #       include <CoreFoundation/CFURL.h>
393 #       include <ApplicationServices/ApplicationServices.h>
394 #       include <CoreServices/CoreServices.h>
395            ],
396            [
397         CFStringRef url_CFString;
398         CFURLRef url_CFURL;
399         OSStatus status;
400         long os_version;
401
402         url_CFString = CFStringCreateWithCString(NULL, "", kCFStringEncodingASCII);
403         url_CFURL = CFURLCreateWithString(NULL, url_CFString, NULL);
404         status = LSOpenCFURLRef(url_CFURL, NULL);
405
406         Gestalt(gestaltSystemVersion, &os_version);
407            ],
408            ac_cv_can_use_osx_frameworks=yes,
409            ac_cv_can_use_osx_frameworks=no,
410            [echo $ac_n "cross compiling; assumed OK... $ac_c"])
411         if test "$ac_cv_can_use_osx_frameworks" = yes ; then
412                 AC_DEFINE(HAVE_OS_X_FRAMEWORKS, 1, [Define to 1 if you have OS X frameworks])
413                 FRAMEWORKS="$ac_frameworks"
414                 AC_MSG_RESULT(yes)
415         else
416                 AC_MSG_RESULT(no)
417         fi
418         LIBS="$ac_save_LIBS"
419         ;;
420 esac
421 AC_SUBST(FRAMEWORKS)
422
423 dnl Look in /usr/local for header files and libraries ?
424 dnl XXX FIXME don't include /usr/local if it is already in the system
425 dnl search path as this causes gcc 3.2 on Linux to complain about a change
426 dnl of the system search order for includes
427 AC_ARG_ENABLE(usr-local,
428   AC_HELP_STRING( [--enable-usr-local],
429                   [look for headers and libs in /usr/local tree.  @<:@default=yes@:>@]),
430     ac_cv_enable_usr_local=$enableval,ac_cv_enable_usr_local=yes)
431
432 AC_MSG_CHECKING(whether to use /usr/local for headers and libraries)
433 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
434         AC_MSG_RESULT(yes)
435         #
436         # Arrange that we search for header files in the source directory
437         # and in its "wiretap" subdirectory, as well as in "/usr/local/include",
438         # as various packages we use ("libpcap", "zlib", "adns", "pcre")
439         # may have been installed under "/usr/local/include".
440         #
441         CFLAGS="$CFLAGS -I/usr/local/include"
442         CPPFLAGS="$CPPFLAGS -I/usr/local/include"
443
444         #
445         # Arrange that we search for libraries in "/usr/local/lib".
446         #
447         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, /usr/local/lib)
448 else
449         AC_MSG_RESULT(no)
450 fi
451
452 #
453 # If we're running Solaris, and LD_LIBRARY_PATH is defined, add it as a
454 # link directory.
455 #
456 case "$host_os" in
457   solaris*)
458     AC_MSG_CHECKING(for LD_LIBRARY_PATH, since you appear to be running Solaris)
459     if test x$LD_LIBRARY_PATH != x ; then
460       LIBS="$LIBS -R$LD_LIBRARY_PATH"
461       AC_MSG_RESULT(yes -- added LD_LIBRARY_PATH to run-time linker path)
462     else
463       AC_MSG_RESULT(no -- this may be a problem in a few seconds)
464     fi
465   ;;
466 esac
467
468 #
469 # Check for versions of "sed" inadequate to handle, in libtool, a list
470 # of object files as large as the list in Wireshark.
471 #
472 # On Solaris, we check for "/bin/sed", "/usr/bin/sed", and "/usr/ucb/sed",
473 # as both "/usr/bin/sed" (which is also "/bin/sed", as "/bin" is just a
474 # symlink to "/usr/bin", but people may have "/bin" before "/usr/bin" in
475 # their search path) and "/usr/ucb/sed" are inadequate; "/usr/xpg4/bin/sed"
476 # is the only "sed" that comes with Solaris that can handle Wireshark.
477 #
478 # Add any checks here that are necessary for other OSes.
479 #
480 AC_WIRESHARK_GNU_SED_CHECK
481 if test "$HAVE_GNU_SED" = no ; then
482         case "$host_os" in
483         solaris*)
484                 AC_MSG_CHECKING(whether one of /usr/bin/sed or /bin/sed or /usr/ucb/sed will be used)
485                 case `which sed` in
486                         /bin/sed|/usr/bin/sed|/usr/ucb/sed)
487                         AC_MSG_RESULT(yes)
488                         AC_MSG_ERROR([change your path to search /usr/xpg4/bin or directory containing GNU sed before /usr/bin (and /bin and /usr/ucb)])
489                         ;;
490
491                         *)
492                         AC_MSG_RESULT(no)
493                         ;;
494                 esac
495                 ;;
496
497         *)
498                 :
499                 ;;
500         esac
501 fi
502
503 # Enable/disable tshark
504
505 AC_ARG_ENABLE(wireshark,
506   AC_HELP_STRING( [--enable-wireshark],
507                   [build GTK+-based wireshark.  @<:@default=yes, if GTK+ available@:>@]),
508     enable_wireshark=$enableval,enable_wireshark=yes)
509
510 AC_ARG_ENABLE(threads,
511   AC_HELP_STRING( [--enable-threads],
512                   [use threads in wireshark.  @<:@default=no@:>@]),
513     enable_threads=$enableval,enable_threads=no)
514 AM_CONDITIONAL(USE_THREADS, test x$enable_threads = xyes)
515
516 AC_ARG_ENABLE(profile-build,
517   AC_HELP_STRING( [--enable-profile-build],
518                   [build profile-ready binaries.  @<:@default=no@:>@]),
519     enable_profile_build=$enableval,enable_profile_build=no)
520 AM_CONDITIONAL(USE_PROFILE_BUILD, test x$enable_profile_build = xyes)
521 AC_MSG_CHECKING(if profile builds must be generated)
522 if test "x$enable_profile_build" = "xyes" ; then
523         if test "x$GCC" = "xyes" ; then
524                 AC_MSG_RESULT(yes)
525                 CFLAGS=" -pg $CFLAGS"
526         else
527                 AC_MSG_RESULT(no)
528                 echo "Building profile binaries currently only supported for GCC."
529         fi
530 else
531         AC_MSG_RESULT(no)
532 fi
533
534 # Create DATAFILE_DIR #define for config.h
535 datafiledir=$datadir/wireshark
536 datafiledir=`(
537     test "x$prefix" = xNONE && prefix=$ac_default_prefix
538     test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
539     # Ugly hack, but I don't see how this problem can be solved
540     # properly that DATAFILE_DIR had a value starting with
541     # "${prefix}/" instead of e.g. "/usr/local/"
542     eval eval echo "$datafiledir"
543 )`
544 AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$datafiledir", [Directory for data])
545
546 # GTK checks
547 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
548 # programs to be built with GTK+.
549 #
550 if test "x$enable_wireshark" = "xyes"; then
551         AM_PATH_GTK_2_0(2.0.0, CFLAGS="$CFLAGS $GTK_CFLAGS", GTK_OK=no, gthread)
552 else
553         GTK_OK=no
554 fi
555
556 # GLib checks
557 # This doesn't add GLIB_CFLAGS to CFLAGS, because AM_PATH_GTK will add
558 # GTK_CFLAGS to CFLAGS, and GTK_CFLAGS is a superset of CFLAGS.
559 # However, this means that both @GLIB_LIBS@ and @GTK_LIBS@ will be
560 # set when generating the Makefile, so we can make programs that require
561 # only GLib link with @GLIB_LIBS@ and make programs that require GTK+
562 # link with @GTK_LIBS@ (which includes @GLIB_LIBS@).
563 # We don't add $GLIB_LIBS to LIBS, because we don't want to force all
564 # programs to be built with GLib.
565 #
566 if test "$GTK_OK" = "no" ; then
567         #
568         # We don't have GTK+.
569         # If they didn't explicitly say "--disable-wireshark", fail (so
570         # that, unless they explicitly indicated that they don't want
571         # Wireshark, we stop so they know they won't be getting
572         # Wireshark unless they fix the GTK+ problem).
573         #
574         if test "x$enable_wireshark" = "xyes"; then
575                 AC_MSG_ERROR([GTK+ isn't available, so Wireshark can't be compiled])
576         fi
577         wireshark_bin=""
578         wireshark_man=""
579         # Honor GLIB_CFLAGS
580         AM_PATH_GLIB_2_0(2.0.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib2 distribution not found.), gmodule)
581
582 else
583         wireshark_bin="wireshark\$(EXEEXT)"
584         wireshark_man="wireshark.1"
585         wireshark_SUBDIRS="codecs gtk"
586         # Honor GLIB_CFLAGS
587         AM_PATH_GLIB_2_0(2.0.0, , AC_MSG_ERROR(GLib distribution not found.), gmodule)
588 fi
589
590 #
591 # Check whether GLib modules are supported, to determine whether we
592 # can support plugins.
593 #
594 AC_MSG_CHECKING(whether GLib supports loadable modules)
595 ac_save_CFLAGS="$CFLAGS"
596 ac_save_LIBS="$LIBS"
597 CFLAGS="$CFLAGS $GLIB_CFLAGS"
598 LIBS="$GLIB_LIBS $LIBS"
599 AC_TRY_RUN([
600 #include <glib.h>
601 #include <gmodule.h>
602 #include <stdio.h>
603 #include <stdlib.h>
604
605 int
606 main ()
607 {
608   if (g_module_supported())
609     return 0;   /* success */
610   else
611     return 1;   /* failure */
612 }
613 ], ac_cv_glib_supports_modules=yes, ac_cv_glib_supports_modules=no,
614    [echo $ac_n "cross compiling; assumed OK... $ac_c"
615     ac_cv_glib_supports_modules=yes])
616 CFLAGS="$ac_save_CFLAGS"
617 LIBS="$ac_save_LIBS"
618 if test "$ac_cv_glib_supports_modules" = yes ; then
619   AC_MSG_RESULT(yes)
620   have_plugins=yes
621 else
622   AC_MSG_RESULT(no)
623   have_plugins=no
624 fi
625
626 #
627 # We can't just check for <inttypes.h> - some systems have one that
628 # doesn't define all the PRI[doxu]64 macros.
629 #
630 AC_CHECK_HEADERS(inttypes.h,
631   [
632     #
633     # OK, we have inttypes.h, but does it define those macros?
634     #
635     AC_MSG_CHECKING([[whether inttypes.h defines the PRI[doxu]64 macros]])
636     AC_COMPILE_IFELSE(
637       [
638         AC_LANG_SOURCE(
639           [[
640             #include <inttypes.h>
641             #include <glib.h>
642             #include <stdio.h>
643             #include <sys/types.h>
644
645             main()
646             {
647               printf("%" PRId64 "\n", (gint64)1);
648               printf("%" PRIo64 "\n", (guint64)1);
649               printf("%" PRIx64 "\n", (guint64)1);
650               printf("%" PRIX64 "\n", (guint64)1);
651               printf("%" PRIu64 "\n", (guint64)1);
652             }
653           ]])
654       ],
655       [
656         AC_MSG_RESULT(yes)
657         ac_wireshark_inttypes_h_defines_formats=yes
658       ],
659       [
660         AC_MSG_RESULT(no)
661         ac_wireshark_inttypes_h_defines_formats=no
662       ])
663   ],
664   [
665     #
666     # We don't have inttypes.h, so it obviously can't define those
667     # macros.
668     #
669     ac_wireshark_inttypes_h_defines_formats=no
670   ])
671 if test "$ac_wireshark_inttypes_h_defines_formats" = yes; then
672   AC_DEFINE(INTTYPES_H_DEFINES_FORMATS,,[Define if <inttypes.h> defines PRI[doxu]64 macros])
673 else
674   AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
675     [
676       AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
677         [
678           AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
679             [
680               AC_MSG_ERROR([neither %llx nor %Lx nor %qx worked on a 64-bit integer])
681             ])
682         ])
683     ])
684 fi
685
686 AC_SUBST(wireshark_bin)
687 AC_SUBST(wireshark_man)
688
689 rdps_bin="rdps\$(EXEEXT)"
690 AC_SUBST(rdps_bin)
691
692
693 # Enable/disable tshark
694
695 AC_ARG_ENABLE(tshark,
696   AC_HELP_STRING( [--enable-tshark],
697                   [build tshark.  @<:@default=yes@:>@]),
698     tshark=$enableval,enable_tshark=yes)
699
700 if test "x$enable_tshark" = "xyes" ; then
701         tshark_bin="tshark\$(EXEEXT)"
702         tshark_man="tshark.1"
703         wiresharkfilter_man="wireshark-filter.4"
704 else
705         tshark_bin=""
706         tshark_man=""
707 fi
708 AC_SUBST(tshark_bin)
709 AC_SUBST(tshark_man)
710 AC_SUBST(wiresharkfilter_man)
711
712
713
714 # Enable/disable editcap
715
716 AC_ARG_ENABLE(editcap,
717   AC_HELP_STRING( [--enable-editcap],
718                   [build editcap.  @<:@default=yes@:>@]),
719     enable_editcap=$enableval,enable_editcap=yes)
720
721 if test "x$enable_editcap" = "xyes" ; then
722         editcap_bin="editcap\$(EXEEXT)"
723         editcap_man="editcap.1"
724 else
725         editcap_bin=""
726         editcap_man=""
727 fi
728 AC_SUBST(editcap_bin)
729 AC_SUBST(editcap_man)
730
731 # Enabling/disabling of dumpcap is done later (after we know if we have PCAP
732 # or not)
733
734 # Enable/disable capinfos
735
736 AC_ARG_ENABLE(capinfos,
737   AC_HELP_STRING( [--enable-capinfos],
738                   [build capinfos.  @<:@default=yes@:>@]),
739     enable_capinfos=$enableval,enable_capinfos=yes)
740
741 if test "x$enable_capinfos" = "xyes" ; then
742         capinfos_bin="capinfos\$(EXEEXT)"
743         capinfos_man="capinfos.1"
744 else
745         capinfos_bin=""
746         capinfos_man=""
747 fi
748 AC_SUBST(capinfos_bin)
749 AC_SUBST(capinfos_man)
750
751
752 # Enable/disable mergecap
753
754 AC_ARG_ENABLE(mergecap,
755   AC_HELP_STRING( [--enable-mergecap],
756                   [build mergecap.  @<:@default=yes@:>@]),
757     enable_mergecap=$enableval,enable_mergecap=yes)
758
759 if test "x$enable_mergecap" = "xyes" ; then
760         mergecap_bin="mergecap\$(EXEEXT)"
761         mergecap_man="mergecap.1"
762 else
763         mergecap_bin=""
764         mergecap_man=""
765 fi
766 AC_SUBST(mergecap_bin)
767 AC_SUBST(mergecap_man)
768
769
770 # Enable/disable text2pcap
771
772 AC_ARG_ENABLE(text2pcap,
773   AC_HELP_STRING( [--enable-text2pcap],
774                   [build text2pcap.  @<:@default=yes@:>@]),
775     text2pcap=$enableval,enable_text2pcap=yes)
776
777 if test "x$enable_text2pcap" = "xyes" ; then
778         text2pcap_bin="text2pcap\$(EXEEXT)"
779         text2pcap_man="text2pcap.1"
780 else
781         text2pcap_bin=""
782         text2pcap_man=""
783 fi
784 AC_SUBST(text2pcap_bin)
785 AC_SUBST(text2pcap_man)
786
787 # Enable/disable idl2wrs
788
789 AC_ARG_ENABLE(idl2wrs,
790   AC_HELP_STRING( [--enable-idl2wrs],
791                   [build idl2wrs.  @<:@default=yes@:>@]),
792     enable_idl2wrs=$enableval,enable_idl2wrs=yes)
793
794 if test "x$enable_idl2wrs" = "xyes" ; then
795         idl2wrs_bin="idl2wrs"
796         idl2wrs_man="idl2wrs.1"
797 else
798         idl2wrs_bin=""
799         idl2wrs_man=""
800 fi
801 AC_SUBST(idl2wrs_bin)
802 AC_SUBST(idl2wrs_man)
803
804
805 # Enable/disable dftest
806
807 AC_ARG_ENABLE(dftest,
808   AC_HELP_STRING( [--enable-dftest],
809                   [build dftest.  @<:@default=yes@:>@]),
810     enable_dftest=$enableval,enable_dftest=yes)
811
812 if test "x$enable_dftest" = "xyes" ; then
813         dftest_bin="dftest\$(EXEEXT)"
814 else
815         dftest_bin=""
816 fi
817 AC_SUBST(dftest_bin)
818
819
820 # Enable/disable randpkt
821
822 AC_ARG_ENABLE(randpkt,
823   AC_HELP_STRING( [--enable-randpkt],
824                   [build randpkt.  @<:@default=yes@:>@]),
825     enable_randpkt=$enableval,enable_randpkt=yes)
826
827 if test "x$enable_randpkt" = "xyes" ; then
828         randpkt_bin="randpkt\$(EXEEXT)"
829 else
830         randpkt_bin=""
831 fi
832 AC_SUBST(randpkt_bin)
833
834
835
836 dnl Checks for "gethostbyname()" - and "-lnsl", if we need it to get
837 dnl "gethostbyname()".
838 AC_WIRESHARK_GETHOSTBY_LIB_CHECK
839
840 dnl Checks for "connect()", used as a proxy for "socket()" - and
841 dnl "-lsocket", if we need it to get "connect()".
842 AC_WIRESHARK_SOCKET_LIB_CHECK
843
844 dnl pcap check
845 AC_MSG_CHECKING(whether to use libpcap for packet capture)
846
847 AC_ARG_WITH(pcap,
848   AC_HELP_STRING( [--with-pcap@<:@=DIR@:>@],
849                   [use libpcap for packet capturing.  @<:@default=yes@:>@]),
850 [
851         if test $withval = no
852         then
853                 want_pcap=no
854         elif test $withval = yes
855         then
856                 want_pcap=yes
857         else
858                 want_pcap=yes
859                 pcap_dir=$withval
860         fi
861 ],[
862         want_pcap=yes
863         pcap_dir=
864 ])
865 if test "x$want_pcap" = "xno" ; then
866         AC_MSG_RESULT(no)
867 else
868         AC_MSG_RESULT(yes)
869         AC_WIRESHARK_PCAP_CHECK
870 fi
871
872 # Enable/disable dumpcap
873
874 dnl dumpcap check
875 AC_MSG_CHECKING(whether to build dumpcap)
876
877 AC_ARG_ENABLE(dumpcap,
878   AC_HELP_STRING( [--enable-dumpcap],
879                   [build dumpcap.  @<:@default=yes@:>@]),
880     enable_dumpcap=$enableval,enable_dumpcap=yes)
881
882 if test "x$enable_dumpcap" = "xyes" ; then
883         if test "x$want_pcap" = "xno" ; then
884                 enable_dumpcap=no
885                 AC_MSG_RESULT(pcap not available - disabling dumpcap)
886         else
887                 AC_MSG_RESULT(yes)
888         fi
889 else
890         AC_MSG_RESULT(no)
891 fi
892
893 if test "x$enable_dumpcap" = "xyes" ; then
894         dumpcap_bin="dumpcap\$(EXEEXT)"
895         dumpcap_man="dumpcap.1"
896 else
897         dumpcap_bin=""
898         dumpcap_man=""
899 fi
900 AC_SUBST(dumpcap_bin)
901 AC_SUBST(dumpcap_man)
902
903 # Enable/disable rawshark
904
905 dnl rawshark check
906 AC_MSG_CHECKING(whether to build rawshark)
907
908 AC_ARG_ENABLE(rawshark,
909   AC_HELP_STRING( [--enable-rawshark],
910                   [build rawshark.  @<:@default=yes@:>@]),
911     rawshark=$enableval,enable_rawshark=yes)
912
913 if test "x$enable_rawshark" = "xyes" ; then
914         if test "x$want_pcap" = "xno" ; then
915                 enable_rawshark=no
916                 AC_MSG_RESULT(pcap not available - disabling rawshark)
917         else
918                 AC_MSG_RESULT(yes)
919         fi
920 else
921         AC_MSG_RESULT(no)
922 fi
923
924 if test "x$enable_rawshark" = "xyes" ; then
925         rawshark_bin="rawshark\$(EXEEXT)"
926         rawshark_man="rawshark.1"
927 else
928         rawshark_bin=""
929         rawshark_man=""
930 fi
931 AC_SUBST(rawshark_bin)
932 AC_SUBST(rawshark_man)
933
934
935 dnl pcap remote check
936 AC_MSG_CHECKING(whether to use libpcap remote capturing feature)
937
938 AC_ARG_WITH(pcap-remote,
939 [  --with-pcap-remote        use libpcap remote capturing (requires libpcap)],
940 [
941     if test $withval = no
942     then
943         want_pcap_remote=no
944     else
945         want_pcap_remote=yes
946     fi
947 ],[
948     want_pcap_remote=no
949 ])
950 if test "x$want_pcap_remote" = "xno" -o "x$want_pcap" = "xno" ; then
951     AC_MSG_RESULT(no)
952 else
953     AC_MSG_RESULT(yes)
954     AC_WIRESHARK_PCAP_REMOTE_CHECK
955 fi
956
957 dnl zlib check
958 AC_MSG_CHECKING(whether to use zlib for reading compressed capture files)
959
960 AC_ARG_WITH(zlib,
961   AC_HELP_STRING( [--with-zlib@<:@=DIR@:>@],
962                   [use zlib (located in directory DIR, if supplied) to read compressed data.  @<:@default=yes, if available@:>@]),
963 [
964         if test $withval = no
965         then
966                 want_zlib=no
967         elif test $withval = yes
968         then
969                 want_zlib=yes
970         else
971                 want_zlib=yes
972                 zlib_dir=$withval
973         fi
974 ],[
975         #
976         # Use zlib if it's present, otherwise don't.
977         #
978         want_zlib=ifavailable
979         zlib_dir=
980 ])
981 if test "x$want_zlib" = "xno" ; then
982         AC_MSG_RESULT(no)
983 else
984         AC_MSG_RESULT(yes)
985         AC_WIRESHARK_ZLIB_CHECK
986         if test "x$want_zlib" = "xno" ; then
987                 AC_MSG_RESULT(zlib not found - disabling compressed capture file support)
988         fi
989 fi
990
991
992 dnl pcre check
993 AC_MSG_CHECKING(whether to use libpcre for regular expressions in dfilters)
994
995 AC_ARG_WITH(pcre,
996   AC_HELP_STRING( [--with-pcre@<:@=DIR@:>@],
997                   [use libpcre (located in directory DIR, if supplied) to use in dfilter regular expressions.  @<:@default=yes, if available@:>@]),
998 [
999         if test $withval = no
1000         then
1001                 want_pcre=no
1002         elif test $withval = yes
1003         then
1004                 want_pcre=yes
1005         else
1006                 want_pcre=yes
1007                 pcre_dir=$withval
1008         fi
1009 ],[
1010         #
1011         # Use libpcre if it's present, otherwise don't.
1012         #
1013         want_pcre=ifavailable
1014         pcre_dir=
1015 ])
1016 if test "x$want_pcre" = "xno" ; then
1017         AC_MSG_RESULT(no)
1018 else
1019         AC_MSG_RESULT(yes)
1020         AC_WIRESHARK_LIBPCRE_CHECK
1021         if test "x$want_pcre" = "xno" ; then
1022                 AC_MSG_RESULT(libpcre not found - disabling support for perl compatible regular expressions in dfilters)
1023         fi
1024 fi
1025
1026
1027 dnl lua check
1028 AC_MSG_CHECKING(whether to use liblua for the lua scripting plugin)
1029
1030 AC_ARG_WITH(lua,
1031   AC_HELP_STRING( [--with-lua@<:@=DIR@:>@],
1032                   [use liblua (located in directory DIR, if supplied) for the lua scripting plugin.  @<:@default=no@:>@]),
1033 [
1034         if test $withval = no
1035         then
1036                 want_lua=no
1037         elif test $withval = yes
1038         then
1039                 want_lua=yes
1040         else
1041                 want_lua=yes
1042                 lua_dir=$withval
1043         fi
1044 ],[
1045         #
1046         # Don't use liblua by default (it isn't ready yet)
1047         #
1048         want_lua=no
1049         lua_dir=
1050 ])
1051 if test "x$want_lua" = "xno" ; then
1052         AC_MSG_RESULT(no)
1053 else
1054         AC_MSG_RESULT(yes)
1055         AC_WIRESHARK_LIBLUA_CHECK
1056         if test "x$want_lua" = "xno" ; then
1057                 AC_MSG_RESULT(liblua not found - disabling support for the lua scripting plugin)
1058         fi
1059 fi
1060 AM_CONDITIONAL(HAVE_LIBLUA, test x$want_lua = xyes)
1061
1062
1063 dnl portaudio check
1064 AC_MSG_CHECKING(whether to use libportaudio for the rtp_player)
1065
1066 AC_ARG_WITH(portaudio,
1067   AC_HELP_STRING( [--with-portaudio@<:@=DIR@:>@],
1068                   [use libportaudio (located in directory DIR, if supplied) for the rtp_player.  @<:@default=yes, if available@:>@]),
1069 [
1070         if test $withval = no
1071         then
1072                 want_portaudio=no
1073         elif test $withval = yes
1074         then
1075                 want_portaudio=yes
1076         else
1077                 want_portaudio=yes
1078                 portaudio_dir=$withval
1079         fi
1080 ],[
1081         #
1082         # Use libportaudio by default
1083         #
1084         want_portaudio=ifavailable
1085         portaudio_dir=
1086 ])
1087 if test "x$want_portaudio" = "xno" ; then
1088         AC_MSG_RESULT(no)
1089 else
1090         AC_MSG_RESULT(yes)
1091         AC_WIRESHARK_LIBPORTAUDIO_CHECK
1092         if test "x$want_portaudio" = "xno" ; then
1093                 AC_MSG_RESULT(libportaudio not found - disabling support for the rtp_player)
1094         fi
1095 fi
1096 AM_CONDITIONAL(HAVE_LIBPORTAUDIO, test x$want_portaudio = xyes)
1097
1098
1099 dnl ipv6 check
1100 AC_ARG_ENABLE(ipv6,
1101   AC_HELP_STRING( [--enable-ipv6],
1102                   [use ipv6 name resolution, if available.  @<:@default=yes@:>@]),
1103     enable_ipv6=$enableval,enable_ipv6=yes)
1104
1105 AC_MSG_CHECKING(whether to enable ipv6 name resolution if available)
1106 if test "x$enable_ipv6" = "xno" ; then
1107         AC_MSG_RESULT(no)
1108 else
1109         AC_MSG_RESULT(yes)
1110         AC_WIRESHARK_IPV6_STACK
1111 fi
1112
1113
1114 dnl Check if dumpcap should be installed setuid
1115 AC_ARG_ENABLE(setuid-install,
1116   AC_HELP_STRING( [--enable-setuid-install],
1117                   [install dumpcap as setuid @<:@default=no@:>@]),
1118     enable_setuid_install=$enableval,enable_setuid_install=no)
1119
1120 AC_MSG_CHECKING(whether to install dumpcap setuid)
1121 if test "x$enable_setuid_install" = "xno" ; then
1122         AC_MSG_RESULT(no)
1123 else
1124         if test "x$enable_dumpcap" = "xno" ; then
1125                 AC_MSG_ERROR(Setuid install works only with dumpcap but dumpcap is disabled)
1126         else
1127                 AC_MSG_RESULT(yes)
1128         fi
1129 fi
1130
1131 AM_CONDITIONAL(SETUID_INSTALL, test x$enable_setuid_install = xyes)
1132 AC_CHECK_FUNCS(setresuid setresgid)
1133
1134 dnl libcap (not libpcap) check
1135 LIBCAP_LIBS=''
1136 AC_MSG_CHECKING(whether to use the libcap capabilities library)
1137
1138 AC_ARG_WITH(libcap,
1139   AC_HELP_STRING( [--with-libcap@<:@=DIR@:>@],
1140                   [use libcap (located in directory DIR, if supplied) for POSIX.1e capabilities management.   @<:@default=yes, if present@:>@]),
1141 [
1142 if   test "x$withval" = "xno";  then
1143         want_libcap=no
1144 elif test "x$withval" = "xyes"; then
1145         want_libcap=yes
1146 elif test -d "$withval"; then
1147         want_libcap=yes
1148         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1149 fi
1150 ])
1151 if test "x$with_libcap" = "xno" ; then
1152         AC_MSG_RESULT(no)
1153 else
1154         AC_MSG_RESULT(yes)
1155         AC_WIRESHARK_LIBCAP_CHECK
1156 fi
1157 AC_SUBST(LIBCAP_LIBS)
1158
1159 dnl Checks for header files.
1160 AC_HEADER_STDC
1161 AC_CHECK_HEADERS(direct.h dirent.h fcntl.h grp.h netdb.h pwd.h stdarg.h stddef.h unistd.h)
1162 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)
1163 AC_CHECK_HEADERS(netinet/in.h)
1164 AC_CHECK_HEADERS(arpa/inet.h arpa/nameser.h)
1165
1166 dnl iconv check
1167 AM_ICONV
1168
1169 dnl SSL Check
1170 SSL_LIBS=''
1171 AC_MSG_CHECKING(whether to use SSL library)
1172
1173 AC_ARG_WITH(ssl,
1174   AC_HELP_STRING( [--with-ssl@<:@=DIR@:>@],
1175                   [use SSL crypto library (located in directory DIR, if supplied).   @<:@default=no@:>@]),
1176 [
1177 if test "x$withval" = "xno";  then
1178         want_ssl=no
1179 elif test "x$withval" = "xyes"; then
1180         want_ssl=yes
1181 elif test -d "$withval"; then
1182         want_ssl=yes
1183         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1184 fi
1185 ],[
1186         want_ssl=no
1187 ])
1188 if test "x$want_ssl" = "xyes"; then
1189         AC_MSG_RESULT(yes)
1190         AC_CHECK_LIB(crypto,EVP_md5,
1191             [
1192                 SSL_LIBS=-lcrypto
1193             ],
1194             [
1195                 AC_MSG_ERROR([SSL crypto library was requested, but is not available])
1196             ])
1197 else
1198         AC_MSG_RESULT(no)
1199 fi
1200 AC_SUBST(SSL_LIBS)
1201
1202 dnl kerberos check
1203 AC_MSG_CHECKING(whether to use kerberos)
1204
1205 AC_ARG_WITH(krb5,
1206   AC_HELP_STRING( [--with-krb5@<:@=DIR@:>@],
1207                   [use kerberos (located in directory DIR, if supplied) to use in kerberos dissection  @<:@default=yes@:>@]),
1208 [
1209         if test $withval = no
1210         then
1211                 want_krb5=no
1212         elif test $withval = yes
1213         then
1214                 want_krb5=yes
1215         else
1216                 want_krb5=yes
1217                 krb5_dir=$withval
1218         fi
1219 ],[
1220         #
1221         # Use kerberos if specified, otherwise don't.
1222         #
1223         want_krb5=ifavailable
1224         krb5_dir=
1225 ])
1226 if test "x$want_krb5" = "xno" ; then
1227         AC_MSG_RESULT(no)
1228 else
1229         AC_MSG_RESULT(yes)
1230         AC_WIRESHARK_KRB5_CHECK
1231 fi
1232
1233
1234 dnl ADNS Check
1235 ADNS_LIBS=''
1236 AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
1237
1238 AC_ARG_WITH(adns,
1239   AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
1240                   [use GNU ADNS (located in directory DIR, if supplied).   @<:@default=yes, if present@:>@]),
1241 [
1242 if   test "x$withval" = "xno";  then
1243         want_adns=no
1244 elif test "x$withval" = "xyes"; then
1245         want_adns=yes
1246 elif test -d "$withval"; then
1247         want_adns=yes
1248         AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1249 fi
1250 ])
1251 if test "x$with_adns" = "xno" ; then
1252         AC_MSG_RESULT(no)
1253 else
1254         AC_MSG_RESULT(yes)
1255         AC_WIRESHARK_ADNS_CHECK
1256 fi
1257 AC_SUBST(ADNS_LIBS)
1258
1259 #
1260 # Define WS_VAR_IMPORT appropriately for declarations of external
1261 # variables exported from dynamically-linked libraries.
1262 #
1263 AC_DEFINE(WS_VAR_IMPORT, extern, [Define as the string to precede external variable declarations in dynamically-linked libraries])
1264
1265 #
1266 # Define HAVE_AIRPDCAP
1267 # We'll want to remove this eventually.
1268 #
1269 AC_DEFINE(HAVE_AIRPDCAP, 1, [Enable AirPDcap (WPA/WPA2 decryption)])
1270
1271 dnl Checks for typedefs, structures, and compiler characteristics.
1272 # AC_C_CONST
1273
1274 # We need to know whether "struct sockaddr" has an "sa_len" member
1275 # for get_interface_list().
1276
1277 AC_WIRESHARK_STRUCT_SA_LEN
1278
1279 # We must know our byte order
1280 AC_C_BIGENDIAN
1281
1282 # Checks whether "-traditional" is needed when using "ioctl".
1283 # XXX - do we need this?
1284 AC_PROG_GCC_TRADITIONAL
1285
1286 #
1287 # Does GLib define G_GINT64_MODIFIER?
1288 #
1289 AC_MSG_CHECKING([[whether glib.h defines the G_GINT64_MODIFIER macro]])
1290 AC_COMPILE_IFELSE(
1291   [
1292     AC_LANG_SOURCE(
1293       [[
1294         #include <glib.h>
1295         #include <glib/gprintf.h>
1296         #include <stdio.h>
1297
1298         main()
1299         {
1300           char strbuf[16+1];
1301           g_snprintf(strbuf, sizeof strbuf, "%" G_GINT64_MODIFIER "x\n", (gint64)1);
1302         }
1303       ]])
1304   ],
1305   [
1306     AC_MSG_RESULT(yes)
1307   ],
1308   [
1309     AC_MSG_RESULT(no)
1310     AC_WIRESHARK_CHECK_64BIT_FORMAT(l,
1311       [
1312       AC_WIRESHARK_CHECK_64BIT_FORMAT(ll,
1313         [
1314           AC_WIRESHARK_CHECK_64BIT_FORMAT(L,
1315             [
1316               AC_WIRESHARK_CHECK_64BIT_FORMAT(q,
1317                 [
1318                   AC_MSG_ERROR([neither %lx nor %llx nor %Lx nor %qx worked on a 64-bit integer])
1319                 ])
1320             ])
1321         ])
1322     ])
1323   ])
1324
1325 GETOPT_C=""
1326 GETOPT_O=""
1327 AC_CHECK_FUNC(getopt, GETOPT_O="",
1328   [GETOPT_O="getopt.o"
1329    AC_DEFINE(NEED_GETOPT_H, 1, [Define if getopt.h needs to be included])
1330 ])
1331 if test "$ac_cv_func_getopt" = no ; then
1332   GETOPT_C="getopt.c"
1333   GETOPT_O="getopt.o"
1334 fi
1335 AC_SUBST(GETOPT_C)
1336 AC_SUBST(GETOPT_O)
1337
1338 AC_CHECK_FUNC(strerror, STRERROR_O="",
1339   [STRERROR_O="strerror.o"
1340    AC_DEFINE(NEED_STRERROR_H, 1, [Define if strerror.h needs to be included])
1341 ])
1342 if test "$ac_cv_func_strerror" = no ; then
1343   STRERROR_C="strerror.c"
1344   STRERROR_O="strerror.o"
1345 fi
1346 AC_SUBST(STRERROR_C)
1347 AC_SUBST(STRERROR_O)
1348
1349 AC_CHECK_FUNC(strcasecmp, STRCASECMP_O="",
1350   STRCASECMP_O="strcasecmp.o")
1351 if test "$ac_cv_func_strcasecmp" = no ; then
1352   STRCASECMP_C="strcasecmp.c"
1353   STRCASECMP_O="strcasecmp.o"
1354 fi
1355 AC_SUBST(STRCASECMP_C)
1356 AC_SUBST(STRCASECMP_O)
1357
1358 AC_CHECK_FUNC(strncasecmp, STRNCASECMP_O="",
1359   STRNCASECMP_O="strncasecmp.o")
1360 if test "$ac_cv_func_strncasecmp" = no ; then
1361   STRNCASECMP_C="strncasecmp.c"
1362   STRNCASECMP_O="strncasecmp.o"
1363 fi
1364 AC_SUBST(STRNCASECMP_C)
1365 AC_SUBST(STRNCASECMP_O)
1366
1367 AC_CHECK_FUNC(mkstemp, MKSTEMP_O="",
1368   MKSTEMP_O="mkstemp.o")
1369 if test "$ac_cv_func_mkstemp" = no ; then
1370   MKSTEMP_C="mkstemp.c"
1371   MKSTEMP_O="mkstemp.o"
1372 fi
1373 AC_SUBST(MKSTEMP_C)
1374 AC_SUBST(MKSTEMP_O)
1375
1376 ac_save_LIBS="$LIBS"
1377 LIBS="$GLIB_LIBS $LIBS"
1378 G_ASCII_STRCASECMP_C=""
1379 G_ASCII_STRCASECMP_O=""
1380 G_ASCII_STRCASECMP_LO=""
1381 AC_CHECK_FUNC(g_ascii_strcasecmp,
1382   [G_ASCII_STRCASECMP_O=""
1383    G_ASCII_STRCASECMP_LO=""],
1384   [G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
1385    G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
1386    AC_DEFINE(NEED_G_ASCII_STRCASECMP_H, 1, [Define if g_ascii_strcasecmp.h needs to be included])
1387 ])
1388 LIBS="$ac_save_LIBS"
1389 if test "$ac_cv_func_g_ascii_strcasecmp" = no ; then
1390   G_ASCII_STRCASECMP_C="g_ascii_strcasecmp.c"
1391   G_ASCII_STRCASECMP_O="g_ascii_strcasecmp.o"
1392   G_ASCII_STRCASECMP_LO="g_ascii_strcasecmp.lo"
1393 fi
1394 AC_SUBST(G_ASCII_STRCASECMP_C)
1395 AC_SUBST(G_ASCII_STRCASECMP_O)
1396 AC_SUBST(G_ASCII_STRCASECMP_LO)
1397
1398 ac_save_LIBS="$LIBS"
1399 LIBS="$GLIB_LIBS $LIBS"
1400 G_ASCII_STRTOULL_C=""
1401 G_ASCII_STRTOULL_O=""
1402 G_ASCII_STRTOULL_LO=""
1403 AC_CHECK_FUNC(g_ascii_strtoull,
1404   [G_ASCII_STRTOULL_O=""
1405    G_ASCII_STRTOULL_LO=""],
1406   [G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1407    G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1408    AC_DEFINE(NEED_G_ASCII_STRTOULL_H, 1, [Define if g_ascii_strtoull.h needs to be included])
1409 ])
1410 LIBS="$ac_save_LIBS"
1411 if test "$ac_cv_func_g_ascii_strtoull" = no ; then
1412   G_ASCII_STRTOULL_C="g_ascii_strtoull.c"
1413   G_ASCII_STRTOULL_O="g_ascii_strtoull.o"
1414   G_ASCII_STRTOULL_LO="g_ascii_strtoull.lo"
1415 fi
1416 AC_SUBST(G_ASCII_STRTOULL_C)
1417 AC_SUBST(G_ASCII_STRTOULL_O)
1418 AC_SUBST(G_ASCII_STRTOULL_LO)
1419
1420 AC_CHECK_FUNC(inet_aton,
1421   [INET_ATON_O=""
1422    INET_ATON_LO=""],
1423   [INET_ATON_O="inet_aton.o"
1424    INET_ATON_LO="inet_aton.lo"
1425 ])
1426 if test "$ac_cv_func_inet_aton" = no ; then
1427   INET_ATON_C="inet_aton.c"
1428   INET_ATON_O="inet_aton.o"
1429   INET_ATON_LO="inet_aton.lo"
1430   AC_DEFINE(NEED_INET_ATON_H, 1, [Define if inet/aton.h needs to be included])
1431 fi
1432 AC_SUBST(INET_ATON_C)
1433 AC_SUBST(INET_ATON_O)
1434 AC_SUBST(INET_ATON_LO)
1435
1436 AC_SEARCH_LIBS(inet_pton, [socket nsl], [
1437   dnl check for pre-BIND82 inet_pton() bug.
1438   AC_MSG_CHECKING(for broken inet_pton)
1439   AC_TRY_RUN([#include <sys/types.h>
1440 #include <sys/socket.h>
1441 #include <netinet/in.h>
1442 #include <arpa/inet.h>
1443 int main()
1444 {
1445 #ifdef AF_INET6
1446   char buf[16];
1447   /* this should return 0 (error) */
1448   return inet_pton(AF_INET6, "0:1:2:3:4:5:6:7:", buf);
1449 #else
1450   return 1;
1451 #endif
1452 }], [AC_MSG_RESULT(ok);
1453 have_inet_pton=yes], [AC_MSG_RESULT(broken);
1454 have_inet_pton=no], [AC_MSG_RESULT(cross compiling, assume it is broken);
1455 have_inet_pton=no])],
1456 have_inet_pton=no)
1457 if test "$have_inet_pton" = no; then
1458   INET_PTON_C="inet_pton.c"
1459   INET_PTON_O="inet_pton.o"
1460   INET_PTON_LO="inet_pton.lo"
1461 else
1462   INET_PTON_C=""
1463   INET_PTON_O=""
1464   INET_PTON_LO=""
1465 fi
1466 AC_SUBST(INET_PTON_C)
1467 AC_SUBST(INET_PTON_O)
1468 AC_SUBST(INET_PTON_LO)
1469
1470 AC_SEARCH_LIBS(inet_ntop, [socket nsl], [
1471   AC_MSG_CHECKING([for inet_ntop prototype])
1472   AC_TRY_COMPILE([#include <stdio.h>
1473 #include <sys/types.h>
1474 #include <sys/socket.h>
1475 #include <netinet/in.h>
1476 #include <arpa/inet.h>
1477
1478 extern const char *inet_ntop(int, const void *, char *, size_t);],, [
1479     AC_MSG_RESULT(yes)
1480     AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1481     [Define if inet_ntop() prototype exists])], [
1482     AC_TRY_COMPILE([#include <stdio.h>
1483 #include <sys/types.h>
1484 #include <sys/socket.h>
1485 #include <netinet/in.h>
1486 #include <arpa/inet.h>
1487
1488 extern const char *inet_ntop(int, const void *, char *, socklen_t);],, [
1489       AC_MSG_RESULT(yes)
1490       AC_DEFINE(HAVE_INET_NTOP_PROTO, 1,
1491       [Define if inet_ntop() prototype exists])], [
1492       AC_MSG_RESULT(no)])])
1493   INET_NTOP_O=""
1494   INET_NTOP_LO=""], [
1495   INET_NTOP_C="inet_ntop.c"
1496   INET_NTOP_O="inet_ntop.o"
1497   INET_NTOP_LO="inet_ntop.lo"
1498   AC_DEFINE(NEED_INET_V6DEFS_H, 1,
1499   [Define if inet/v6defs.h needs to be included])])
1500 AC_SUBST(INET_NTOP_C)
1501 AC_SUBST(INET_NTOP_O)
1502 AC_SUBST(INET_NTOP_LO)
1503
1504 AC_CHECK_FUNC(strptime, STRPTIME_O="",
1505   [STRPTIME_O="strptime.o"
1506    AC_DEFINE(NEED_STRPTIME_H, 1, [Define if strptime.h needs to be included])
1507 ])
1508 if test "$ac_cv_func_strptime" = no ; then
1509   STRPTIME_C="strptime.c"
1510   STRPTIME_O="strptime.o"
1511 fi
1512 AC_SUBST(STRPTIME_C)
1513 AC_SUBST(STRPTIME_O)
1514
1515 AC_CHECK_FUNCS(getprotobynumber gethostbyname2)
1516 AC_CHECK_FUNCS(issetugid)
1517 AC_CHECK_FUNCS(mmap mprotect sysconf)
1518
1519 dnl blank for now, but will be used in future
1520 AC_SUBST(wireshark_SUBDIRS)
1521
1522 dnl
1523 dnl check whether plugins should be enabled and, if they should be,
1524 dnl check for plugins directory - stolen from Amanda's configure.in
1525 dnl
1526 dnl we don't wish to expand ${libdir} yet
1527 plugindir='${libdir}/wireshark/plugins/${VERSION}'
1528 AC_ARG_WITH(plugins,
1529   AC_HELP_STRING( [--with-plugins@<:@=DIR@:>@],
1530                   [support plugins (installed in DIR, if supplied).   @<:@default=yes, if possible@:>@]),
1531 [
1532   if test "x$withval" = "xno"; then
1533     have_plugins=no
1534   elif test "x$have_plugins" = "xno"; then
1535       AC_MSG_ERROR([GLib on this platform doesn't support loadable modules, so you can't enable plugins.])
1536   elif test "x$withval" != "xyes"; then
1537       plugindir="$withval"
1538   fi
1539 ])
1540 AM_CONDITIONAL(HAVE_PLUGINS, test "x$have_plugins" = "xyes")
1541 if test x$have_plugins = xyes
1542 then
1543   AC_DEFINE(HAVE_PLUGINS, 1, [Define if plugins are enabled])
1544 fi
1545 AC_SUBST(plugindir)
1546 CPPFLAGS="$CPPFLAGS '-DPLUGIN_DIR=\"\$(plugindir)\"'"
1547
1548 #
1549 # The plugin dissectors reside in ./plugins/PROTO/
1550 #
1551 PLUGIN_LIBS=""
1552 AC_SUBST(PLUGIN_LIBS)
1553
1554 dnl libtool defs
1555 #
1556 # Yes, AM_PROG_LIBTOOL is redundant with newer version(s) of some tool(s)
1557 # (autoconf?  automake?  libtool?) - with the newer version(s), it's
1558 # just an alias for AC_PROG_LIBTOOL, which is called earlier.
1559 #
1560 # With older version(s) of those tool(s), however, it's not just an
1561 # alias, and the configure scripts don't work without it.
1562 #
1563 AM_PROG_LIBTOOL
1564 AC_SUBST(LIBTOOL_DEPS)
1565
1566 AM_CONDITIONAL(ENABLE_STATIC, test x$enable_static = xyes)
1567 if test x$enable_static = xyes -a x$have_plugins = xyes
1568 then
1569   AC_DEFINE(ENABLE_STATIC, 1, [Link plugins statically into Wireshark])
1570 fi
1571 AC_SUBST(ENABLE_STATIC)
1572
1573 dnl Save the cacheable configure results to config.cache before recursing
1574 AC_CACHE_SAVE
1575
1576 AM_CONFIG_HEADER(config.h)
1577 AC_OUTPUT(
1578   Makefile
1579   doxygen.cfg
1580   asn1/Makefile
1581   asn1/acp133/Makefile
1582   asn1/acse/Makefile
1583   asn1/ansi_map/Makefile
1584   asn1/ansi-tcap/Makefile
1585   asn1/camel/Makefile
1586   asn1/cdt/Makefile
1587   asn1/cmip/Makefile
1588   asn1/cms/Makefile
1589   asn1/dap/Makefile
1590   asn1/disp/Makefile
1591   asn1/dop/Makefile
1592   asn1/dsp/Makefile
1593   asn1/ess/Makefile
1594   asn1/ftam/Makefile
1595   asn1/gnm/Makefile
1596   asn1/gsmmap/Makefile
1597   asn1/h225/Makefile
1598   asn1/h235/Makefile
1599   asn1/h245/Makefile
1600   asn1/h248/Makefile
1601   asn1/h282/Makefile
1602   asn1/h283/Makefile
1603   asn1/h323/Makefile
1604   asn1/h450/Makefile
1605   asn1/h450-ros/Makefile
1606   asn1/h460/Makefile
1607   asn1/h501/Makefile
1608   asn1/inap/Makefile
1609   asn1/ldap/Makefile
1610   asn1/logotype-cert-extn/Makefile
1611   asn1/mms/Makefile
1612   asn1/mpeg-audio/Makefile
1613   asn1/mpeg-pes/Makefile
1614   asn1/nbap/Makefile
1615   asn1/ns-cert-exts/Makefile
1616   asn1/ocsp/Makefile
1617   asn1/p7/Makefile
1618   asn1/pcap/Makefile
1619   asn1/pkcs1/Makefile
1620   asn1/pkcs12/Makefile
1621   asn1/pkinit/Makefile
1622   asn1/pkix1explicit/Makefile
1623   asn1/pkix1implicit/Makefile
1624   asn1/pkixcmp/Makefile
1625   asn1/pkixcrmf/Makefile
1626   asn1/pkixproxy/Makefile
1627   asn1/pkixqualified/Makefile
1628   asn1/pkixtsp/Makefile
1629   asn1/pres/Makefile
1630   asn1/q932/Makefile
1631   asn1/q932-ros/Makefile
1632   asn1/qsig/Makefile
1633   asn1/ranap/Makefile
1634   asn1/rnsap/Makefile
1635   asn1/ros/Makefile
1636   asn1/rrc/Makefile
1637   asn1/rrlp/Makefile
1638   asn1/rtse/Makefile
1639   asn1/s1ap/Makefile
1640   asn1/s4406/Makefile
1641   asn1/sabp/Makefile
1642   asn1/smrse/Makefile
1643   asn1/snmp/Makefile
1644   asn1/spnego/Makefile
1645   asn1/t125/Makefile
1646   asn1/t38/Makefile
1647   asn1/tcap/Makefile
1648   asn1/ulp/Makefile
1649   asn1/wlancertextn/Makefile
1650   asn1/x2ap/Makefile
1651   asn1/x411/Makefile
1652   asn1/x420/Makefile
1653   asn1/x509af/Makefile
1654   asn1/x509ce/Makefile
1655   asn1/x509if/Makefile
1656   asn1/x509sat/Makefile
1657   asn1/x721/Makefile
1658   doc/Makefile
1659   epan/Makefile
1660   epan/crypt/Makefile
1661   epan/doxygen.cfg
1662   epan/dfilter/Makefile
1663   epan/dissectors/Makefile
1664   epan/ftypes/Makefile
1665   epan/wslua/Makefile
1666   codecs/Makefile
1667   gtk/Makefile
1668   gtk/doxygen.cfg
1669   help/Makefile
1670   packaging/Makefile
1671   packaging/macosx/Info.plist
1672   packaging/nsis/Makefile
1673   packaging/rpm/Makefile
1674   packaging/rpm/SPECS/Makefile
1675   packaging/rpm/SPECS/wireshark.spec
1676   packaging/svr4/Makefile
1677   packaging/svr4/checkinstall
1678   packaging/svr4/pkginfo
1679   plugins/Makefile
1680   plugins/agentx/Makefile
1681   plugins/artnet/Makefile
1682   plugins/asn1/Makefile
1683   plugins/ciscosm/Makefile
1684   plugins/docsis/Makefile
1685   plugins/enttec/Makefile
1686   plugins/ethercat/Makefile
1687   plugins/giop/Makefile
1688   plugins/gryphon/Makefile
1689   plugins/infiniband/Makefile
1690   plugins/irda/Makefile
1691   plugins/lwres/Makefile
1692   plugins/m2m/Makefile
1693   plugins/mate/Makefile
1694   plugins/opcua/Makefile
1695   plugins/opsi/Makefile
1696   plugins/pcli/Makefile
1697   plugins/profinet/Makefile
1698   plugins/rlm/Makefile
1699   plugins/rtnet/Makefile
1700   plugins/rudp/Makefile
1701   plugins/sbus/Makefile
1702   plugins/stats_tree/Makefile
1703   plugins/unistim/Makefile
1704   plugins/v5ua/Makefile
1705   plugins/wimax/Makefile
1706   plugins/wimaxasncp/Makefile
1707   tools/Makefile
1708   tools/idl2wrs.sh
1709   tools/lemon/Makefile
1710   wiretap/Makefile
1711   ,)
1712 dnl AC_CONFIG_FILES([tools/setuid-root.pl], [chmod +x tools/setuid-root.pl])
1713
1714
1715 # Pretty messages
1716
1717 if test "x$enable_setuid_install" = "xyes" ; then
1718         setuid_message="yes"
1719 else
1720         setuid_message="no"
1721 fi
1722
1723 if test "x$want_zlib" = "xno" ; then
1724         zlib_message="no"
1725 else
1726         zlib_message="yes"
1727 fi
1728
1729 if test "x$want_pcre" = "xno" ; then
1730         pcre_message="no"
1731 else
1732         pcre_message="yes"
1733 fi
1734
1735 if test "x$want_lua" = "xyes" -a "x$have_plugins" = "xyes" ; then
1736         lua_message="yes"
1737 else
1738         lua_message="no"
1739 fi
1740
1741 if test "x$want_portaudio" = "xyes" ; then
1742         portaudio_message="yes"
1743 else
1744         portaudio_message="no"
1745 fi
1746
1747 if test "x$want_ssl" = "xno" ; then
1748         ssl_message="no"
1749 else
1750         ssl_message="yes"
1751 fi
1752
1753 if test "x$want_krb5" = "xno" ; then
1754         krb5_message="no"
1755 else
1756         krb5_message="yes ($ac_krb5_version)"
1757 fi
1758
1759 if test "x$have_good_adns" = "xyes" ; then
1760         adns_message="yes"
1761 else
1762         adns_message="no"
1763 fi
1764
1765 if test "x$have_good_libcap" = "xyes" ; then
1766         libcap_message="yes"
1767 else
1768         libcap_message="no"
1769 fi
1770
1771 echo ""
1772 echo "The Wireshark package has been configured with the following options."
1773 echo "                    Build wireshark : $enable_wireshark"
1774 echo "                       Build tshark : $enable_tshark"
1775 echo "                     Build capinfos : $enable_capinfos"
1776 echo "                      Build editcap : $enable_editcap"
1777 echo "                      Build dumpcap : $enable_dumpcap"
1778 echo "                     Build mergecap : $enable_mergecap"
1779 echo "                    Build text2pcap : $enable_text2pcap"
1780 echo "                      Build idl2wrs : $enable_idl2wrs"
1781 echo "                      Build randpkt : $enable_randpkt"
1782 echo "                       Build dftest : $enable_dftest"
1783 echo "                     Build rawshark : $enable_rawshark"
1784 echo ""
1785 echo "             Install dumpcap setuid : $setuid_message"
1786 echo "                        Use plugins : $have_plugins"
1787 echo "                   Build lua plugin : $lua_message"
1788 echo "                   Build rtp_player : $portaudio_message"
1789 echo "                        Use threads : $enable_threads"
1790 echo "             Build profile binaries : $enable_profile_build"
1791 echo "                   Use pcap library : $want_pcap"
1792 echo "                   Use zlib library : $zlib_message"
1793 echo "                   Use pcre library : $pcre_message"
1794 echo "               Use kerberos library : $krb5_message"
1795 echo "               Use GNU ADNS library : $adns_message"
1796 echo "                Use SMI MIB library : $libsmi_message"
1797 echo "             Use GNU crypto library : $gcrypt_message"
1798 echo "             Use SSL crypto library : $ssl_message"
1799 echo "           Use IPv6 name resolution : $enable_ipv6"
1800 echo "                 Use gnutls library : $tls_message"
1801 echo "                 Use libcap library : $libcap_message"