1 dnl Macros that test for specific features.
2 dnl This file is part of the Autoconf packaging for Wireshark.
3 dnl Copyright (C) 1998-2000 by Gerald Combs.
7 dnl This program is free software; you can redistribute it and/or modify
8 dnl it under the terms of the GNU General Public License as published by
9 dnl the Free Software Foundation; either version 2, or (at your option)
10 dnl any later version.
12 dnl This program is distributed in the hope that it will be useful,
13 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
14 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 dnl GNU General Public License for more details.
17 dnl You should have received a copy of the GNU General Public License
18 dnl along with this program; if not, write to the Free Software
19 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
22 dnl As a special exception, the Free Software Foundation gives unlimited
23 dnl permission to copy, distribute and modify the configure scripts that
24 dnl are the output of Autoconf. You need not follow the terms of the GNU
25 dnl General Public License when using or distributing such scripts, even
26 dnl though portions of the text of Autoconf appear in them. The GNU
27 dnl General Public License (GPL) does govern all other use of the material
28 dnl that constitutes the Autoconf program.
30 dnl Certain portions of the Autoconf source text are designed to be copied
31 dnl (in certain cases, depending on the input) into the output of
32 dnl Autoconf. We call these the "data" portions. The rest of the Autoconf
33 dnl source text consists of comments plus executable code that decides which
34 dnl of the data portions to output in any given case. We call these
35 dnl comments and executable code the "non-data" portions. Autoconf never
36 dnl copies any of the non-data portions into its output.
38 dnl This special exception to the GPL applies to versions of Autoconf
39 dnl released by the Free Software Foundation. When you make and
40 dnl distribute a modified version of Autoconf, you may extend this special
41 dnl exception to the GPL to apply to your modified version as well, *unless*
42 dnl your modified version has the potential to copy into its output some
43 dnl of the text that was the non-data portion of the version that you started
44 dnl with. (In other words, unless your change moves or copies text from
45 dnl the non-data portions to the data portions.) If your modification has
46 dnl such potential, you must delete any notice of this special exception
47 dnl to the GPL from your modified version.
49 dnl Written by David MacKenzie, with help from
50 dnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
51 dnl Roland McGrath, Noah Friedman, david d zuhn, and many others.
54 # AC_WIRESHARK_ADD_DASH_L
56 # Add to the variable specified as the first argument a "-L" flag for the
57 # directory specified as the second argument, and, on Solaris, add a
58 # "-R" flag for it as well.
60 # XXX - IRIX, and other OSes, may require some flag equivalent to
63 AC_DEFUN([AC_WIRESHARK_ADD_DASH_L],
73 # AC_WIRESHARK_TIMEZONE_ABBREV
76 AC_DEFUN([AC_WIRESHARK_TIMEZONE_ABBREV],
78 AC_CACHE_CHECK([for tm_zone in struct tm],
79 ac_cv_wireshark_have_tm_zone,
83 [struct tm t; t.tm_zone;],
84 ac_cv_wireshark_have_tm_zone=yes,
85 ac_cv_wireshark_have_tm_zone=no)
87 if test $ac_cv_wireshark_have_tm_zone = yes; then
88 AC_DEFINE(HAVE_TM_ZONE, 1, [Define if tm_zone field exists in struct tm])
90 AC_CACHE_CHECK([for tzname],
91 ac_cv_wireshark_have_tzname,
96 [printf("%s", tzname[0]);],
97 ac_cv_wireshark_have_tzname=yes,
98 ac_cv_wireshark_have_tzname=no)
100 if test $ac_cv_wireshark_have_tzname = yes; then
101 AC_DEFINE(HAVE_TZNAME, 1, [Define if tzname array exists])
108 # AC_WIRESHARK_STRUCT_SA_LEN
110 dnl AC_STRUCT_ST_BLKSIZE extracted from the file in question,
111 dnl "acspecific.m4" in GNU Autoconf 2.12, and turned into
112 dnl AC_WIRESHARK_STRUCT_SA_LEN, which checks if "struct sockaddr"
113 dnl has the 4.4BSD "sa_len" member, and defines HAVE_SA_LEN; that's
114 dnl what's in this file.
115 dnl Done by Guy Harris <guy@alum.mit.edu> on 1998-11-14.
117 dnl ### Checks for structure members
119 AC_DEFUN([AC_WIRESHARK_STRUCT_SA_LEN],
120 [AC_CACHE_CHECK([for sa_len in struct sockaddr], ac_cv_wireshark_struct_sa_len,
121 [AC_TRY_COMPILE([#include <sys/types.h>
122 #include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
123 ac_cv_wireshark_struct_sa_len=yes, ac_cv_wireshark_struct_sa_len=no)])
124 if test $ac_cv_wireshark_struct_sa_len = yes; then
125 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
131 # AC_WIRESHARK_IPV6_STACK
133 # By Jun-ichiro "itojun" Hagino, <itojun@iijlab.net>
135 AC_DEFUN([AC_WIRESHARK_IPV6_STACK],
140 AC_MSG_CHECKING([ipv6 stack type])
141 for i in v6d toshiba kame inria zeta linux linux-glibc solaris8; do
145 #include </usr/local/v6/include/sys/types.h>
149 [v6type=$i; v6lib=v6;
150 v6libdir=/usr/local/v6/lib;
151 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
155 #include <sys/param.h>
156 #ifdef _TOSHIBA_INET6
159 [v6type=$i; v6lib=inet6;
160 v6libdir=/usr/local/v6/lib;
161 CFLAGS="-DINET6 $CFLAGS"])
165 #include <netinet/in.h>
169 [v6type=$i; v6lib=inet6;
170 v6libdir=/usr/local/v6/lib;
171 CFLAGS="-DINET6 $CFLAGS"])
175 #include <netinet/in.h>
176 #ifdef IPV6_INRIA_VERSION
179 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
183 #include <sys/param.h>
184 #ifdef _ZETA_MINAMI_INET6
187 [v6type=$i; v6lib=inet6;
188 v6libdir=/usr/local/v6/lib;
189 CFLAGS="-DINET6 $CFLAGS"])
192 if test -d /usr/inet6; then
196 CFLAGS="-DINET6 $CFLAGS"
201 #include <features.h>
202 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
203 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ > 2
207 [v6type=$i; v6lib=inet6; CFLAGS="-DINET6 $CFLAGS"])
210 if test "`uname -s`" = "SunOS" && test "`uname -r`" = "5.8"; then
213 [CFLAGS="-DINET6 -DSOLARIS8_INET6 $CFLAGS"]
217 if test "$v6type" != "unknown"; then
222 if test "$v6lib" != "none"; then
223 for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
224 if test -d $dir -a -f $dir/lib$v6lib.a; then
225 LIBS="-L$dir $LIBS -l$v6lib"
233 AC_MSG_RESULT(["$v6type, $v6lib"])
237 # AC_WIRESHARK_GETHOSTBY_LIB_CHECK
239 # Checks whether we need "-lnsl" to get "gethostby*()", which we use
242 # Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
243 # GNU Autoconf 2.13; the comment came from there.
244 # Done by Guy Harris <guy@alum.mit.edu> on 2000-01-14.
246 AC_DEFUN([AC_WIRESHARK_GETHOSTBY_LIB_CHECK],
248 # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
249 # to get the SysV transport functions.
250 # chad@anasazi.com says the Pyramid MIS-ES running DC/OSx (SVR4)
252 # The nsl library prevents programs from opening the X display
253 # on Irix 5.2, according to dickey@clark.net.
254 AC_CHECK_FUNC(gethostbyname, ,
255 AC_CHECK_LIB(nsl, gethostbyname, NSL_LIBS="-lnsl"))
260 # AC_WIRESHARK_SOCKET_LIB_CHECK
262 # Checks whether we need "-lsocket" to get "socket()", which is used
263 # by libpcap on some platforms - and, in effect, "gethostby*()" on
264 # most if not all platforms (so that it can use NIS or DNS or...
265 # to look up host names).
267 # Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
268 # GNU Autoconf 2.13; the comment came from there.
269 # Done by Guy Harris <guy@alum.mit.edu> on 2000-01-14.
271 # We use "connect" because that's what AC_PATH_XTRA did.
273 AC_DEFUN([AC_WIRESHARK_SOCKET_LIB_CHECK],
275 # lieder@skyler.mavd.honeywell.com says without -lsocket,
276 # socket/setsockopt and other routines are undefined under SCO ODT
277 # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
278 # on later versions), says simon@lia.di.epfl.ch: it contains
279 # gethostby* variants that don't use the nameserver (or something).
280 # -lsocket must be given before -lnsl if both are needed.
281 # We assume that if connect needs -lnsl, so does gethostbyname.
282 AC_CHECK_FUNC(connect, ,
283 AC_CHECK_LIB(socket, connect, SOCKET_LIBS="-lsocket",
284 AC_MSG_ERROR(Function 'socket' not found.), $NSL_LIBS))
285 AC_SUBST(SOCKET_LIBS)
289 # AC_WIRESHARK_BREAKLOOP_TRY_LINK
291 AC_DEFUN([AC_WIRESHARK_PCAP_BREAKLOOP_TRY_LINK],
307 ws_breakloop_compiled=yes
310 ws_breakloop_compiled=no
317 # AC_WIRESHARK_PCAP_CHECK
319 AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
321 if test -z "$pcap_dir"
324 # XXX need to set a var AC_CHECK_HEADER(pcap.h,,)
327 # The user didn't specify a directory in which libpcap resides.
328 # First, look for a pcap-config script.
330 AC_PATH_PROG(PCAP_CONFIG, pcap-config)
332 if test -n "$PCAP_CONFIG" ; then
336 # Now check whether it's the libpcap 1.0 version, which
337 # put a space after "-L" - on some platforms, that doesn't
340 AC_MSG_CHECKING(for broken pcap-config)
341 case "`\"$PCAP_CONFIG\" --libs`" in
345 # Space after -L. Pretend pcap-config doesn't exist.
359 if test -n "$PCAP_CONFIG" ; then
361 # Found it, and it's usable; use it to get the include flags
364 CFLAGS="$CFLAGS `\"$PCAP_CONFIG\" --cflags`"
365 CPPFLAGS="$CPPFLAGS `\"$PCAP_CONFIG\" --cflags`"
368 # Didn't find it; we have to look for libpcap ourselves.
369 # We assume that the current library search path will work,
370 # but we may have to look for the header in a "pcap"
371 # subdirectory of "/usr/include" or "/usr/local/include",
372 # as some systems apparently put "pcap.h" in a "pcap"
373 # subdirectory, and we also check "$prefix/include" - and
374 # "$prefix/include/pcap", in case $prefix is set to
375 # "/usr/include" or "/usr/local/include".
377 # XXX - should we just add "$prefix/include" to the include
378 # search path and "$prefix/lib" to the library search path?
380 AC_MSG_CHECKING(for extraneous pcap header directories)
382 pcap_dir_list="/usr/include/pcap $prefix/include/pcap $prefix/include"
383 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
384 pcap_dir_list="$pcap_dir_list /usr/local/include/pcap"
386 for pcap_dir in $pcap_dir_list
388 if test -d $pcap_dir ; then
389 if test x$pcap_dir != x/usr/include -a x$pcap_dir != x/usr/local/include ; then
390 CFLAGS="$CFLAGS -I$pcap_dir"
391 CPPFLAGS="$CPPFLAGS -I$pcap_dir"
393 found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
398 if test "$found_pcap_dir" != "" ; then
399 AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
401 AC_MSG_RESULT(not found)
406 # The user specified a directory in which libpcap resides,
407 # so add the "include" subdirectory of that directory to
408 # the include file search path and the "lib" subdirectory
409 # of that directory to the library search path.
411 # XXX - if there's also a libpcap in a directory that's
412 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
413 # make us find the version in the specified directory,
414 # as the compiler and/or linker will search that other
415 # directory before it searches the specified directory.
417 CFLAGS="$CFLAGS -I$pcap_dir/include"
418 CPPFLAGS="$CPPFLAGS -I$pcap_dir/include"
419 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, $pcap_dir/lib)
423 AC_CHECK_HEADER(pcap.h,,
424 AC_MSG_ERROR([[Header file pcap.h not found; if you installed libpcap
425 from source, did you also do \"make install-incl\", and if you installed a
426 binary package of libpcap, is there also a developer's package of libpcap,
427 and did you also install that package?]]))
429 if test -n "$PCAP_CONFIG" ; then
431 # We have pcap-config; we assume that means we have libpcap
432 # installed and that pcap-config will tell us whatever
433 # libraries libpcap needs.
435 if test x$enable_static = xyes; then
436 PCAP_LIBS="`\"$PCAP_CONFIG\" --libs --static`"
438 PCAP_LIBS="`\"$PCAP_CONFIG\" --libs`"
440 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
443 # Check to see if we find "pcap_open_live" in "-lpcap".
444 # Also check for various additional libraries that libpcap might
447 AC_CHECK_LIB(pcap, pcap_open_live,
450 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
452 ac_wireshark_extras_found=no
454 for extras in "-lcfg -lodm" "-lpfring"
456 AC_MSG_CHECKING([for pcap_open_live in -lpcap with $extras])
457 LIBS="-lpcap $extras"
459 # XXX - can't we use AC_CHECK_LIB here?
466 pcap_open_live(NULL, 0, 0, 0, NULL);
469 ac_wireshark_extras_found=yes
471 PCAP_LIBS="-lpcap $extras"
472 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
477 if test x$ac_wireshark_extras_found = xyes
482 if test x$ac_wireshark_extras_found = xno
484 AC_MSG_ERROR([Can't link with library libpcap.])
487 ], $SOCKET_LIBS $NSL_LIBS)
492 # Check whether various variables and functions are defined by
496 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
497 LIBS="$PCAP_LIBS $SOCKET_LIBS $NSL_LIBS $LIBS"
501 extern char *pcap_version;
504 printf ("%s\n", pcap_version);
506 ac_cv_pcap_version_defined=yes,
507 ac_cv_pcap_version_defined=no,
508 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
509 if test "$ac_cv_pcap_version_defined" = yes ; then
511 AC_DEFINE(HAVE_PCAP_VERSION, 1, [Define if libpcap version is known])
515 AC_CHECK_FUNCS(pcap_open_dead pcap_freecode)
517 # pcap_breakloop may be present in the library but not declared
518 # in the pcap.h header file. If it's not declared in the header
519 # file, attempts to use it will get warnings, and, if we're
520 # building with warnings treated as errors, that warning will
521 # cause compilation to fail.
523 # We are therefore first testing whether the function is present
524 # and then, if we're compiling with warnings as errors, testing
525 # whether it is usable. It is usable if it compiles without
526 # a -Wimplicit warning (the "compile with warnings as errors"
527 # option requires GCC). If it is not usable, we fail and tell
528 # the user that the pcap.h header needs to be updated.
530 # Ceteris paribus, this should only happen with Mac OS X 10.3[.x] which
531 # can have an up-to-date pcap library without the corresponding pcap
534 # However, it might also happen on some others OSes with some erroneous
535 # system manipulations where multiple versions of libcap might co-exist
536 # e.g. hand made symbolic link from libpcap.so -> libpcap.so.0.8 but
537 # having the pcap header version 0.7.
539 AC_MSG_CHECKING([whether pcap_breakloop is present])
540 ac_CFLAGS_saved="$CFLAGS"
541 AC_WIRESHARK_PCAP_BREAKLOOP_TRY_LINK
542 if test "x$ws_breakloop_compiled" = "xyes"; then
544 AC_DEFINE(HAVE_PCAP_BREAKLOOP, 1, [Define if pcap_breakloop is known])
545 if test "x$with_warnings_as_errors" = "xyes"; then
546 AC_MSG_CHECKING([whether pcap_breakloop is usable])
547 CFLAGS="$CFLAGS -Werror -Wimplicit"
548 AC_WIRESHARK_PCAP_BREAKLOOP_TRY_LINK
549 if test "x$ws_breakloop_compiled" = "xyes"; then
554 [Your pcap library is more recent than your pcap header.
555 As you are building with compiler warnings treated as errors, Wireshark
556 won't be able to use functions not declared in that header.
557 If you wish to build with compiler warnings treated as errors, You should
558 install a newer version of the header file.])
560 CFLAGS="$ac_CFLAGS_saved"
567 # Later versions of Mac OS X 10.3[.x] ship a pcap.h that
568 # doesn't define pcap_if_t but ship an 0.8[.x] libpcap,
569 # so the library has "pcap_findalldevs()", but pcap.h
570 # doesn't define "pcap_if_t" so you can't actually *use*
571 # "pcap_findalldevs()".
573 # That even appears to be true of systems shipped with
574 # 10.3.4, so it doesn't appear only to be a case of
575 # Software Update not updating header files.
577 # (You can work around this by installing the 0.8 header
580 AC_CACHE_CHECK([whether pcap_findalldevs is present and usable],
581 [ac_cv_func_pcap_findalldevs],
590 pcap_if_t *devpointer;
593 pcap_findalldevs(&devpointer, errbuf);
598 ac_cv_func_pcap_findalldevs=yes
601 ac_cv_func_pcap_findalldevs=no
605 # Don't check for other new routines that showed up after
606 # "pcap_findalldevs()" if we don't have a usable
607 # "pcap_findalldevs()", so we don't end up using them if the
608 # "pcap.h" is crufty and old and doesn't declare them.
610 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
611 AC_DEFINE(HAVE_PCAP_FINDALLDEVS, 1,
612 [Define to 1 if you have the `pcap_findalldevs' function and a pcap.h that declares pcap_if_t.])
613 AC_CHECK_FUNCS(pcap_datalink_val_to_name pcap_datalink_name_to_val)
614 AC_CHECK_FUNCS(pcap_datalink_val_to_description)
615 AC_CHECK_FUNCS(pcap_list_datalinks pcap_set_datalink pcap_lib_version)
616 AC_CHECK_FUNCS(pcap_get_selectable_fd pcap_free_datalinks)
617 AC_CHECK_FUNCS(pcap_create bpf_image)
622 AC_DEFUN([AC_WIRESHARK_PCAP_REMOTE_CHECK],
625 LIBS="$PCAP_LIBS $SOCKET_LIBS $NSL_LIBS $LIBS"
626 AC_DEFINE(HAVE_REMOTE, 1, [Define to 1 to enable remote
627 capturing feature in WinPcap library])
628 AC_CHECK_FUNCS(pcap_open pcap_findalldevs_ex pcap_createsrcstr)
629 if test $ac_cv_func_pcap_open = "yes" -a \
630 $ac_cv_func_pcap_findalldevs_ex = "yes" -a \
631 $ac_cv_func_pcap_createsrcstr = "yes" ; then
632 AC_DEFINE(HAVE_PCAP_REMOTE, 1,
633 [Define to 1 if you have WinPcap remote capturing support and prefer to use these new API features.])
635 AC_CHECK_FUNCS(pcap_setsampling)
640 # AC_WIRESHARK_ZLIB_CHECK
642 AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
644 if test "x$zlib_dir" != "x"
647 # The user specified a directory in which zlib resides,
648 # so add the "include" subdirectory of that directory to
649 # the include file search path and the "lib" subdirectory
650 # of that directory to the library search path.
652 # XXX - if there's also a zlib in a directory that's
653 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
654 # make us find the version in the specified directory,
655 # as the compiler and/or linker will search that other
656 # directory before it searches the specified directory.
658 wireshark_save_CFLAGS="$CFLAGS"
659 CFLAGS="$CFLAGS -I$zlib_dir/include"
660 wireshark_save_CPPFLAGS="$CPPFLAGS"
661 CPPFLAGS="$CPPFLAGS -I$zlib_dir/include"
662 wireshark_save_LIBS="$LIBS"
663 AC_WIRESHARK_ADD_DASH_L(LIBS, $zlib_dir/lib)
667 # Make sure we have "zlib.h". If we don't, it means we probably
668 # don't have zlib, so don't use it.
670 AC_CHECK_HEADER(zlib.h,,
672 if test "x$zlib_dir" != "x"
675 # The user used "--with-zlib=" to specify a directory
676 # containing zlib, but we didn't find the header file
677 # there; that either means they didn't specify the
678 # right directory or are confused about whether zlib
679 # is, in fact, installed. Report the error and give up.
681 AC_MSG_ERROR([zlib header not found in directory specified in --with-zlib])
683 if test "x$want_zlib" = "xyes"
686 # The user tried to force us to use the library, but we
687 # couldn't find the header file; report an error.
689 AC_MSG_ERROR(Header file zlib.h not found.)
692 # We couldn't find the header file; don't use the
693 # library, as it's probably not present.
700 if test "x$want_zlib" != "xno"
703 # Well, we at least have the zlib header file.
704 # We link with zlib to support uncompression of
705 # gzipped network traffic, e.g. in an HTTP request
708 if test "x$zlib_dir" != "x"
711 # Put the "-I" and "-L" flags for zlib at
712 # the beginning of CFLAGS, CPPFLAGS, and
716 AC_WIRESHARK_ADD_DASH_L(LIBS, $zlib_dir/lib)
717 LIBS="$LIBS -lz $wireshark_save_LIBS"
721 AC_DEFINE(HAVE_LIBZ, 1, [Define to use libz library])
724 # Check for "inflatePrime()" in zlib, which we need
725 # in order to read compressed capture files.
727 AC_CHECK_FUNCS(inflatePrime)
729 if test "x$ac_cv_func_inflatePrime" = "xyes" ; then
731 # Now check for "inflatePrime()" in zlib when
732 # linking with the linker flags for GTK+
733 # applications; people often grab XFree86 source
734 # and build and install it on their systems,
735 # and they appear sometimes to misconfigure
736 # XFree86 so that, even on systems with zlib,
737 # it assumes there is no zlib, so the XFree86
738 # build process builds and installs its
739 # own zlib in the X11 library directory.
741 # The zlib in at least some versions of XFree86
742 # is an older version that may lack "inflatePrime()",
743 # and that's the zlib with which Wireshark gets
744 # linked, so the build of Wireshark fails.
746 AC_MSG_CHECKING([for inflatePrime missing when linking with X11])
747 AC_TRY_LINK_FUNC(inflatePrime, AC_MSG_RESULT(no),
750 AC_MSG_ERROR(old zlib found when linking with X11 - get rid of old zlib.)
755 # Restore the versions of CFLAGS, CPPFLAGS,
756 # and LIBS before we added the "-with-zlib="
757 # directory, as we didn't actually find
760 CFLAGS="$wireshark_save_CFLAGS"
761 CPPFLAGS="$wireshark_save_CPPFLAGS"
762 LIBS="$wireshark_save_LIBS"
768 # AC_WIRESHARK_LIBPCRE_CHECK
770 AC_DEFUN([AC_WIRESHARK_LIBPCRE_CHECK],
772 if test "x$pcre_dir" != "x"
775 # The user specified a directory in which libpcre resides,
776 # so add the "include" subdirectory of that directory to
777 # the include file search path and the "lib" subdirectory
778 # of that directory to the library search path.
780 # XXX - if there's also a libpcre in a directory that's
781 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
782 # make us find the version in the specified directory,
783 # as the compiler and/or linker will search that other
784 # directory before it searches the specified directory.
786 wireshark_save_CFLAGS="$CFLAGS"
787 CFLAGS="$CFLAGS -I$pcre_dir/include"
788 wireshark_save_CPPFLAGS="$CPPFLAGS"
789 CPPFLAGS="$CPPFLAGS -I$pcre_dir/include"
790 wireshark_save_LIBS="$LIBS"
792 wireshark_save_LDFLAGS="$LDFLAGS"
793 LDFLAGS="$LDFLAGS -L$pcre_dir/lib"
797 # Make sure we have "pcre.h". If we don't, it means we probably
798 # don't have libpcre, so don't use it.
800 AC_CHECK_HEADER(pcre.h,,
802 if test "x$pcre_dir" != "x"
805 # The user used "--with-pcre=" to specify a directory
806 # containing libpcre, but we didn't find the header file
807 # there; that either means they didn't specify the
808 # right directory or are confused about whether libpcre
809 # is, in fact, installed. Report the error and give up.
811 AC_MSG_ERROR([libpcre header not found in directory specified in --with-pcre])
813 if test "x$want_pcre" = "xyes"
816 # The user tried to force us to use the library, but we
817 # couldn't find the header file; report an error.
819 AC_MSG_ERROR(Header file pcre.h not found.)
822 # We couldn't find the header file; don't use the
823 # library, as it's probably not present.
830 if test "x$want_pcre" != "xno"
833 # Well, we at least have the pcre header file.
835 # We're only using standard functions from libpcre,
836 # so we don't need to perform extra checks.
838 AC_CHECK_LIB(pcre, pcre_compile,
840 if test "x$pcre_dir" != "x"
843 # Put the "-I" and "-L" flags for pcre at
844 # the beginning of CFLAGS, CPPFLAGS,
847 PCRE_LIBS="-L$pcre_dir/lib -lpcre $wireshark_save_LIBS"
851 AC_DEFINE(HAVE_LIBPCRE, 1, [Define to use libpcre library])
853 if test "x$pcre_dir" != "x"
856 # Restore the versions of CFLAGS, CPPFLAGS,
857 # LDFLAGS, and LIBS before we added the
858 # "--with-pcre=" directory, as we didn't
859 # actually find pcre there.
861 CFLAGS="$wireshark_save_CFLAGS"
862 CPPFLAGS="$wireshark_save_CPPFLAGS"
863 LDFLAGS="$wireshark_save_LDFLAGS"
864 LIBS="$wireshark_save_LIBS"
874 # AC_WIRESHARK_LIBLUA_CHECK
876 AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
878 if test "x$lua_dir" != "x"
881 # The user specified a directory in which liblua resides,
882 # so add the "include" subdirectory of that directory to
883 # the include file search path and the "lib" subdirectory
884 # of that directory to the library search path.
886 # XXX - if there's also a liblua in a directory that's
887 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
888 # make us find the version in the specified directory,
889 # as the compiler and/or linker will search that other
890 # directory before it searches the specified directory.
892 wireshark_save_CFLAGS="$CFLAGS"
893 CFLAGS="$CFLAGS -I$lua_dir/include"
894 wireshark_save_CPPFLAGS="$CPPFLAGS"
895 CPPFLAGS="$CPPFLAGS -I$lua_dir/include"
896 wireshark_save_LIBS="$LIBS"
897 LIBS="$LIBS -L$lua_dir/lib -llua -lm"
898 wireshark_save_LDFLAGS="$LDFLAGS"
899 LDFLAGS="$LDFLAGS -L$lua_dir/lib"
902 # The user specified no directory in which liblua resides,
903 # so just add "-llua -lliblua" to the used libs.
905 wireshark_save_CFLAGS="$CFLAGS"
906 wireshark_save_CPPFLAGS="$CPPFLAGS"
907 wireshark_save_LDFLAGS="$LDFLAGS"
908 wireshark_save_LIBS="$LIBS"
909 LIBS="$LIBS -llua -lm"
913 # Make sure we have "lua.h", "lualib.h" and "lauxlib.h". If we don't, it means we probably
914 # don't have liblua, so don't use it.
916 AC_CHECK_HEADERS(lua.h lualib.h lauxlib.h,,
918 AC_CHECK_HEADERS(lua5.1/lua.h lua5.1/lualib.h lua5.1/lauxlib.h,
920 if test "x$lua_dir" != "x"
922 LUA_INCLUDES="-I$lua_dir/include/lua5.1"
925 # The user didn't specify a directory in which liblua resides;
926 # we must look for the headers in a "lua5.1" subdirectory of
927 # "/usr/include", "/usr/local/include", or "$prefix/include"
928 # as some systems apparently put the headers in a "lua5.1"
930 AC_MSG_CHECKING(for extraneous lua header directories)
932 lua_dir_list="/usr/include/lua5.1 $prefix/include/lua5.1"
933 if test "x$ac_cv_enable_usr_local" = "xyes"
935 lua_dir_list="$lua_dir_list /usr/local/include/lua5.1"
937 for lua_dir_ent in $lua_dir_list
939 if test -d $lua_dir_ent
941 LUA_INCLUDES="-I$lua_dir_ent"
942 found_lua_dir="$lua_dir_ent"
947 if test "x$found_lua_dir" != "x"
949 AC_MSG_RESULT(found -- $found_lua_dir)
951 AC_MSG_RESULT(not found)
953 # Restore the versions of CFLAGS, CPPFLAGS,
954 # LDFLAGS, and LIBS before we added the
955 # "--with-lua=" directory, as we didn't
956 # actually find lua there.
958 CFLAGS="$wireshark_save_CFLAGS"
959 CPPFLAGS="$wireshark_save_CPPFLAGS"
960 LDFLAGS="$wireshark_save_LDFLAGS"
961 LIBS="$wireshark_save_LIBS"
963 if test "x$want_lua" = "xyes"
965 # we found lua5.1/lua.h, but we don't know which include dir contains it
966 AC_MSG_ERROR(Header file lua.h was found as lua5.1/lua.h but we can't locate the include directory. Please set the DIR for the --with-lua configure parameter.)
969 # We couldn't find the header file; don't use the
970 # library, as it's probably not present.
979 # Restore the versions of CFLAGS, CPPFLAGS,
980 # LDFLAGS, and LIBS before we added the
981 # "--with-lua=" directory, as we didn't
982 # actually find lua there.
984 CFLAGS="$wireshark_save_CFLAGS"
985 CPPFLAGS="$wireshark_save_CPPFLAGS"
986 LDFLAGS="$wireshark_save_LDFLAGS"
987 LIBS="$wireshark_save_LIBS"
989 if test "x$lua_dir" != "x"
992 # The user used "--with-lua=" to specify a directory
993 # containing liblua, but we didn't find the header file
994 # there; that either means they didn't specify the
995 # right directory or are confused about whether liblua
996 # is, in fact, installed. Report the error and give up.
998 AC_MSG_ERROR([liblua header not found in directory specified in --with-lua])
1000 if test "x$want_lua" = "xyes"
1003 # The user tried to force us to use the library, but we
1004 # couldn't find the header file; report an error.
1006 AC_MSG_ERROR(Header file lua.h not found.)
1009 # We couldn't find the header file; don't use the
1010 # library, as it's probably not present.
1018 if test "x$want_lua" != "xno"
1021 # Well, we at least have the lua header file.
1023 # let's check if the libs are there
1026 # At least on Suse 9.3 systems, liblualib needs linking
1028 LIBS="$LIBS $LUA_LIBS -lm"
1030 AC_CHECK_LIB(lua, luaL_register,
1035 if test "x$lua_dir" != "x"
1038 # Put the "-I" and "-L" flags for lua at
1039 # the beginning of CFLAGS, CPPFLAGS,
1040 # LDFLAGS, and LIBS.
1042 LUA_LIBS="-L$lua_dir/lib -llua -lm"
1043 LUA_INCLUDES="-I$lua_dir/include"
1045 LUA_LIBS="-llua -lm"
1048 AC_DEFINE(HAVE_LUA_5_1, 1, [Define to use Lua 5.1])
1053 # We could not find the libs, maybe we have version number in the lib name
1056 LIBS="$wireshark_save_LIBS -llua5.1 -lm"
1058 AC_CHECK_LIB(lua5.1, luaL_register,
1063 LUA_LIBS=" -llua5.1 -lm"
1064 AC_DEFINE(HAVE_LUA_5_1, 1, [Define to use Lua 5.1])
1068 # Restore the versions of CFLAGS, CPPFLAGS,
1069 # LDFLAGS, and LIBS before we added the
1070 # "--with-lua=" directory, as we didn't
1071 # actually find lua there.
1073 CFLAGS="$wireshark_save_CFLAGS"
1074 CPPFLAGS="$wireshark_save_CPPFLAGS"
1075 LDFLAGS="$wireshark_save_LDFLAGS"
1076 LIBS="$wireshark_save_LIBS"
1078 # User requested --with-lua but it isn't available
1079 if test "x$want_lua" = "xyes"
1081 AC_MSG_ERROR(Linking with liblua failed.)
1087 CFLAGS="$wireshark_save_CFLAGS"
1088 CPPFLAGS="$wireshark_save_CPPFLAGS"
1089 LDFLAGS="$wireshark_save_LDFLAGS"
1090 LIBS="$wireshark_save_LIBS"
1092 AC_SUBST(LUA_INCLUDES)
1098 # AC_WIRESHARK_LIBPORTAUDIO_CHECK
1100 AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
1102 if test "x$portaudio_dir" != "x"
1105 # The user specified a directory in which libportaudio
1106 # resides, so add the "include" subdirectory of that directory to
1107 # the include file search path and the "lib" subdirectory
1108 # of that directory to the library search path.
1110 # XXX - if there's also a libportaudio in a directory that's
1111 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
1112 # make us find the version in the specified directory,
1113 # as the compiler and/or linker will search that other
1114 # directory before it searches the specified directory.
1116 wireshark_save_CFLAGS="$CFLAGS"
1117 CFLAGS="$CFLAGS -I$portaudio_dir/include"
1118 wireshark_save_CPPFLAGS="$CPPFLAGS"
1119 CPPFLAGS="$CPPFLAGS -I$portaudio_dir/include"
1120 wireshark_save_LIBS="$LIBS"
1121 LIBS="$LIBS -L$portaudio_dir/lib -lportaudio"
1122 wireshark_save_LDFLAGS="$LDFLAGS"
1123 LDFLAGS="$LDFLAGS -L$portaudio_dir/lib"
1126 # The user specified no directory in which libportaudio resides,
1127 # so just add "-lportaudio" to the used libs.
1129 wireshark_save_CFLAGS="$CFLAGS"
1130 wireshark_save_CPPFLAGS="$CPPFLAGS"
1131 wireshark_save_LDFLAGS="$LDFLAGS"
1132 wireshark_save_LIBS="$LIBS"
1133 LIBS="$LIBS -lportaudio"
1137 # Make sure we have "portaudio.h". If we don't, it means we probably
1138 # don't have libportaudio, so don't use it.
1140 AC_CHECK_HEADERS(portaudio.h,,
1142 if test "x$portaudio_dir" != "x"
1145 # The user used "--with-portaudio=" to specify a directory
1146 # containing libportaudio, but we didn't find the header file
1147 # there; that either means they didn't specify the
1148 # right directory or are confused about whether libportaudio
1149 # is, in fact, installed. Report the error and give up.
1151 AC_MSG_ERROR([libportaudio header not found in directory specified in --with-portaudio])
1153 CFLAGS="$wireshark_save_CFLAGS"
1154 CPPFLAGS="$wireshark_save_CPPFLAGS"
1155 LDFLAGS="$wireshark_save_LDFLAGS"
1156 LIBS="$wireshark_save_LIBS"
1158 if test "x$want_portaudio" = "xyes"
1161 # The user tried to force us to use the library, but we
1162 # couldn't find the header file; report an error.
1164 AC_MSG_ERROR(Header file portaudio.h not found.)
1167 # We couldn't find the header file; don't use the
1168 # library, as it's probably not present.
1176 # Check whether we have the right version of portaudio
1178 if test "x$want_portaudio" != "xno"
1180 AC_CHECK_TYPE(PortAudioStream,
1181 AC_DEFINE(PORTAUDIO_API_1, 1, [Define if we are using version of of the Portaudio library API]),
1183 [#include <portaudio.h>])
1186 if test "x$want_portaudio" != "xno"
1189 # Well, we at least have the portaudio header file.
1191 # let's check if the libs are there
1194 AC_CHECK_LIB(portaudio, Pa_Initialize,
1196 if test "x$portaudio_dir" != "x"
1199 # Put the "-I" and "-L" flags for portaudio at
1200 # the beginning of CFLAGS, CPPFLAGS,
1201 # LDFLAGS, and LIBS.
1203 PORTAUDIO_LIBS="-L$portaudio_dir/lib -lportaudio"
1204 PORTAUDIO_INCLUDES="-I$portaudio_dir/include"
1206 PORTAUDIO_LIBS="-lportaudio"
1207 PORTAUDIO_INCLUDES=""
1209 AC_DEFINE(HAVE_LIBPORTAUDIO, 1, [Define to use libportaudio library])
1213 # Restore the versions of CFLAGS, CPPFLAGS,
1214 # LDFLAGS, and LIBS before we added the
1215 # "--with-portaudio=" directory, as we didn't
1216 # actually find portaudio there.
1218 CFLAGS="$wireshark_save_CFLAGS"
1219 CPPFLAGS="$wireshark_save_CPPFLAGS"
1220 LDFLAGS="$wireshark_save_LDFLAGS"
1221 LIBS="$wireshark_save_LIBS"
1223 # User requested --with-portaudio but it isn't available
1224 if test "x$want_portaudio" = "xyes"
1226 AC_MSG_ERROR(Linking with libportaudio failed.)
1231 CFLAGS="$wireshark_save_CFLAGS"
1232 CPPFLAGS="$wireshark_save_CPPFLAGS"
1233 LDFLAGS="$wireshark_save_LDFLAGS"
1234 LIBS="$wireshark_save_LIBS"
1235 AC_SUBST(PORTAUDIO_LIBS)
1236 AC_SUBST(PORTAUDIO_INCLUDES)
1242 # AC_WIRESHARK_RPM_CHECK
1243 # Looks for the rpm program, and checks to see if we can redefine "_topdir".
1245 AC_DEFUN([AC_WIRESHARK_RPM_CHECK],
1247 AC_CHECK_PROG(ac_cv_wireshark_have_rpm, rpm, "yes", "no")
1248 if test "x$ac_cv_wireshark_have_rpm" = "xyes"; then
1249 rpm --define '_topdir /tmp' > /dev/null 2>&1
1250 AC_MSG_CHECKING(to see if we can redefine _topdir)
1251 if test $? -eq 0 ; then
1255 AC_MSG_RESULT(no. You'll have to build packages manually.)
1262 # AC_WIRESHARK_GNU_SED_CHECK
1263 # Checks if GNU sed is the first sed in PATH.
1265 AC_DEFUN([AC_WIRESHARK_GNU_SED_CHECK],
1267 AC_MSG_CHECKING(for GNU sed as first sed in PATH)
1268 if ( sh -c "sed --version" </dev/null 2> /dev/null | grep "GNU sed" 2>&1 > /dev/null ) ; then
1278 # AC_WIRESHARK_C_ARES_CHECK
1280 AC_DEFUN([AC_WIRESHARK_C_ARES_CHECK],
1282 want_c_ares=defaultyes
1284 if test "x$want_c_ares" = "xdefaultyes"; then
1286 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1288 if test -d "$withval"; then
1289 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1294 if test "x$want_c_ares" = "xyes"; then
1295 AC_CHECK_LIB(cares, ares_init,
1298 AC_DEFINE(HAVE_C_ARES, 1, [Define to use c-ares library])
1299 have_good_c_ares=yes
1300 ],, $SOCKET_LIBS $NSL_LIBS
1303 AC_MSG_RESULT(not required)
1309 # AC_WIRESHARK_ADNS_CHECK
1311 AC_DEFUN([AC_WIRESHARK_ADNS_CHECK],
1313 want_adns=defaultyes
1315 if test "x$want_adns" = "xdefaultyes"; then
1317 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1319 if test -d "$withval"; then
1320 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1325 if test "x$want_adns" = "xyes"; then
1326 AC_CHECK_LIB(adns, adns_init,
1329 AC_DEFINE(HAVE_GNU_ADNS, 1, [Define to use GNU ADNS library])
1331 ],, $SOCKET_LIBS $NSL_LIBS
1334 AC_MSG_RESULT(not required)
1340 # AC_WIRESHARK_LIBCAP_CHECK
1342 AC_DEFUN([AC_WIRESHARK_LIBCAP_CHECK],
1344 want_libcap=defaultyes
1346 if test "x$want_libcap" = "xdefaultyes"; then
1348 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1350 if test -d "$withval"; then
1351 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1356 if test "x$want_libcap" = "xyes"; then
1357 AC_CHECK_LIB(cap, cap_set_flag,
1360 AC_DEFINE(HAVE_LIBCAP, 1, [Define to use the libcap library])
1361 have_good_libcap=yes
1365 AC_MSG_RESULT(not required)
1371 # AC_WIRESHARK_KRB5_CHECK
1373 AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
1375 wireshark_save_CFLAGS="$CFLAGS"
1376 wireshark_save_CPPFLAGS="$CPPFLAGS"
1377 if test "x$krb5_dir" != "x"
1380 # The user specified a directory in which kerberos resides,
1381 # so add the "include" subdirectory of that directory to
1382 # the include file search path and the "lib" subdirectory
1383 # of that directory to the library search path.
1385 # XXX - if there's also a kerberos in a directory that's
1386 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
1387 # make us find the version in the specified directory,
1388 # as the compiler and/or linker will search that other
1389 # directory before it searches the specified directory.
1391 CFLAGS="$CFLAGS -I$krb5_dir/include"
1392 CPPFLAGS="$CPPFLAGS -I$krb5_dir/include"
1393 ac_heimdal_version=`grep heimdal $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/'`
1394 # MIT Kerberos moved krb5.h to krb5/krb5.h starting with release 1.5
1395 ac_mit_version_olddir=`grep 'Massachusetts Institute of Technology' $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*Massachusetts Institute of Technology.*$/MIT/'`
1396 ac_mit_version_newdir=`grep 'Massachusetts Institute of Technology' $krb5_dir/include/krb5/krb5.h | head -n 1 | sed 's/^.*Massachusetts Institute of Technology.*$/MIT/'`
1397 ac_krb5_version="$ac_heimdal_version$ac_mit_version_olddir$ac_mit_version_newdir"
1398 if test "x$ac_krb5_version" = "xHEIMDAL"
1399 KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lasn1 $SSL_LIBS -lroken -lcrypt"
1401 KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lk5crypto -lcom_err"
1403 if test "x$ac_krb5_version" = "xMIT"
1405 AC_DEFINE(HAVE_MIT_KERBEROS, 1, [Define to use MIT kerberos])
1408 AC_PATH_PROG(KRB5_CONFIG, krb5-config)
1409 if test -x "$KRB5_CONFIG"
1411 KRB5_FLAGS=`"$KRB5_CONFIG" --cflags`
1412 KRB5_LIBS=`"$KRB5_CONFIG" --libs`
1413 CFLAGS="$CFLAGS $KRB5_FLAGS"
1414 CPPFLAGS="$CPPFLAGS $KRB5_FLAGS"
1416 # If -lcrypto is in KRB5_FLAGS, we require it to build
1417 # with Heimdal/MIT. We don't want to built with it by
1418 # default, due to annoying license incompatibilities
1419 # between the OpenSSL license and the GPL, so:
1421 # if SSL_LIBS is set to a non-empty string, we
1422 # remove -lcrypto from KRB5_LIBS and replace
1425 # if SSL_LIBS is not set to a non-empty string
1426 # we fail with an appropriate error message.
1428 case "$KRB5_LIBS" in
1430 if test ! -z "$SSL_LIBS"
1432 KRB5_LIBS=`echo $KRB5_LIBS | sed 's/-lcrypto//'`
1433 KRB5_LIBS="$KRB5_LIBS $SSL_LIBS"
1435 AC_MSG_ERROR([Kerberos library requires -lcrypto but --with-ssl not specified])
1439 ac_krb5_version=`"$KRB5_CONFIG" --version | head -n 1 | sed -e 's/^.*heimdal.*$/HEIMDAL/' -e 's/^Kerberos .*$/MIT/' -e 's/^Solaris Kerberos .*$/MIT/'`
1444 # Make sure we have "krb5.h". If we don't, it means we probably
1445 # don't have kerberos, so don't use it.
1447 AC_CHECK_HEADER(krb5.h,,
1449 if test "x$krb5_dir" != "x"
1452 # The user used "--with-krb5=" to specify a directory
1453 # containing kerberos, but we didn't find the header file
1454 # there; that either means they didn't specify the
1455 # right directory or are confused about whether kerberos
1456 # is, in fact, installed. Report the error and give up.
1458 AC_MSG_ERROR([kerberos header not found in directory specified in --with-krb5])
1460 if test "x$want_krb5" = "xyes"
1463 # The user tried to force us to use the library, but we
1464 # couldn't find the header file; report an error.
1466 AC_MSG_ERROR(Header file krb5.h not found.)
1469 # We couldn't find the header file; don't use the
1470 # library, as it's probably not present.
1473 AC_MSG_RESULT(No Heimdal or MIT header found - disabling dissection for some kerberos data in packet decoding)
1478 if test "x$want_krb5" != "xno"
1481 # Well, we at least have the krb5 header file.
1482 # Check whether this is Heimdal or MIT.
1484 AC_MSG_CHECKING(whether the Kerberos library is Heimdal or MIT)
1485 if test "x$ac_krb5_version" = "xHEIMDAL" -o "x$ac_krb5_version" = "xMIT"
1489 # Check whether we have krb5_kt_resolve - and whether
1490 # we need to link with -lresolv when linking with
1491 # the Kerberos library.
1493 AC_MSG_RESULT($ac_krb5_version)
1494 wireshark_save_LIBS="$LIBS"
1495 found_krb5_kt_resolve=no
1496 for extras in "" "-lresolv"
1498 LIBS="$KRB5_LIBS $extras"
1499 if test -z "$extras"
1501 AC_MSG_CHECKING([whether $ac_krb5_version includes krb5_kt_resolve])
1503 AC_MSG_CHECKING([whether $ac_krb5_version includes krb5_kt_resolve (linking with $extras)])
1513 # We found "krb5_kt_resolve()", and required
1514 # the libraries in extras as well.
1518 AC_DEFINE(HAVE_KERBEROS, 1, [Define to use kerberos])
1519 if test "x$ac_krb5_version" = "xHEIMDAL"
1521 AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1, [Define to use heimdal kerberos])
1522 elif test "x$ac_krb5_version" = "xMIT"
1524 AC_DEFINE(HAVE_MIT_KERBEROS, 1, [Define to use MIT kerberos])
1526 found_krb5_kt_resolve=yes
1533 if test "$found_krb5_kt_resolve" = no
1536 # We didn't find "krb5_kt_resolve()" in the
1537 # Kerberos library, even when we tried linking
1538 # with -lresolv; we can't link with kerberos.
1540 if test "x$want_krb5" = "xyes"
1543 # The user tried to force us to use the library,
1544 # but we can't do so; report an error.
1546 AC_MSG_ERROR(Usable $ac_krb5_version not found)
1549 # Restore the versions of CFLAGS and CPPFLAGS
1550 # from before we added the flags for Kerberos.
1552 AC_MSG_RESULT(Usable $ac_krb5_version not found - disabling dissection for some kerberos data in packet decoding)
1553 CFLAGS="$wireshark_save_CFLAGS"
1554 CPPFLAGS="$wireshark_save_CPPFLAGS"
1560 # We can link with Kerberos; see whether krb5.h
1561 # defines KEYTYPE_ARCFOUR_56 (where "defines" means
1562 # "as a #define or as an enum member).
1564 AC_MSG_CHECKING([whether krb5.h defines KEYTYPE_ARCFOUR_56])
1574 printf("%u\n", KEYTYPE_ARCFOUR_56);
1580 AC_DEFINE(HAVE_KEYTYPE_ARCFOUR_56, 1, [Define if krb5.h defines KEYTYPE_ARCFOUR_56])
1586 LIBS="$wireshark_save_LIBS"
1589 # It's not Heimdal or MIT.
1592 if test "x$want_krb5" = "xyes"
1595 # The user tried to force us to use the library,
1596 # but we can't do so; report an error.
1598 AC_MSG_ERROR(Kerberos not found)
1601 # Restore the versions of CFLAGS and CPPFLAGS
1602 # from before we added the flags for Kerberos.
1604 AC_MSG_RESULT(Kerberos not found - disabling dissection for some kerberos data in packet decoding)
1605 CFLAGS="$wireshark_save_CFLAGS"
1606 CPPFLAGS="$wireshark_save_CPPFLAGS"
1613 # The user asked us not to use Kerberos, or they didn't
1614 # say whether they wanted us to use it but we found
1617 # Restore the versions of CFLAGS and CPPFLAGS
1618 # from before we added the flags for Kerberos.
1620 CFLAGS="$wireshark_save_CFLAGS"
1621 CPPFLAGS="$wireshark_save_CPPFLAGS"
1629 # AC_WIRESHARK_GEOIP_CHECK
1631 AC_DEFUN([AC_WIRESHARK_GEOIP_CHECK],
1633 want_geoip=defaultyes
1635 if test "x$want_geoip" = "xdefaultyes"; then
1637 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1639 if test -d "$withval"; then
1640 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1645 if test "x$want_geoip" = "xyes"; then
1646 AC_CHECK_LIB(GeoIP, GeoIP_new,
1649 AC_DEFINE(HAVE_GEOIP, 1, [Define to use GeoIP library])
1654 AC_MSG_RESULT(not required)
1658 #AC_WIRESHARK_LDFLAGS_CHECK
1660 # $1 : ldflag(s) to test
1662 # The macro first determines if the compiler supports "-Wl,{option}" to
1663 # pass options through to the linker. Then it attempts to compile with
1664 # the defined ldflags. The defined flags are added to LDFLAGS only if
1665 # the compilation succeeds.
1667 AC_DEFUN([AC_WIRESHARK_LDFLAGS_CHECK],
1669 AC_MSG_CHECKING(whether we can add $GCC_OPTION to LDFLAGS)
1670 if test "x$ac_supports_W_linker_passthrough" = "xyes"; then
1671 LDFLAGS_saved="$CFLAGS"
1672 LDFLAGS="$LDFLAGS $GCC_OPTION"
1682 LDFLAGS="$LDFLAGS_saved"
1690 # AC_WIRESHARK_GCC_CFLAGS_CHECK
1692 # $1 : cflags to test
1694 # The macro first determines if the compiler supports GCC-style flags.
1695 # Then it attempts to compile with the defined cflags. The defined
1696 # flags are added to CFLAGS only if the compilation succeeds.
1698 # We do this because not all such options are necessarily supported by
1699 # the version of the particular compiler we're using.
1701 # NOTE: clang, by default, only warns about unknown -W options.
1702 # If we're using clang, we turn on -Werror=unknown-warning-option
1703 # so that it fails if we pass it a -W option it doesn't know about
1704 # but doesn't fail for any other warning that the test program might
1707 AC_DEFUN([AC_WIRESHARK_GCC_CFLAGS_CHECK],
1709 AC_MSG_CHECKING(whether we can add $GCC_OPTION to CFLAGS)
1710 if test "x$ac_supports_gcc_flags" = "xyes" ; then
1711 CFLAGS_saved="$CFLAGS"
1712 CFLAGS="$CFLAGS $GCC_OPTION"
1713 if test "x$CC" = "xclang" ; then
1714 CFLAGS="$CFLAGS -Werror=unknown-warning-option"
1725 CFLAGS="$CFLAGS_saved"
1733 # AC_WIRESHARK_OSX_INTEGRATION_CHECK
1735 # Checks for the presence of OS X integration functions in the GTK+ framework
1736 # or as a separate library.
1738 # http://sourceforge.net/apps/trac/gtk-osx/wiki/Integrate
1740 # http://live.gnome.org/GTK%2B/OSX/Integration
1741 # for the old Carbon-based integration functions
1743 # http://gtk-osx.sourceforge.net/ige-mac-integration/
1744 # for the new Cocoa-based integration functions
1746 AC_DEFUN([AC_WIRESHARK_OSX_INTEGRATION_CHECK],
1748 ac_save_CFLAGS="$CFLAGS"
1749 ac_save_LIBS="$LIBS"
1750 CFLAGS="$CFLAGS $GTK_CFLAGS"
1751 LIBS="$GTK_LIBS $LIBS"
1754 # Check for the new integration functions in a -ligemacintegration
1757 AC_CHECK_LIB(igemacintegration, gtk_osxapplication_set_menu_bar,
1759 AC_DEFINE(HAVE_GTKOSXAPPLICATION, 1,
1760 [Define to 1 if -ligemacintegration includes the GtkOSXApplication Integration functions.])
1762 # We don't want gtk stuff in LIBS (which is reset below) so
1763 # manually set GTK_LIBS (which is more appropriate)
1764 GTK_LIBS="$GTK_LIBS -ligemacintegration"
1767 if test x$have_ige_mac = x
1770 # Not found - check for the old integration functions in
1771 # the Gtk framework.
1773 AC_CHECK_LIB(Gtk, ige_mac_menu_set_menu_bar,
1775 AC_DEFINE(HAVE_IGE_MAC_INTEGRATION, 1,
1776 [Define to 1 if the the Gtk+ framework or a separate library includes the Imendio IGE Mac OS X Integration functions.])
1778 # We don't want gtk stuff in LIBS (which is reset below) so
1779 # manually set GTK_LIBS (which is more appropriate)
1780 GTK_LIBS="$GTK_LIBS -lGtk"
1784 if test x$have_ige_mac = x
1787 # Not found - check for the old integration functions in
1788 # a -ligemacintegration library.
1790 AC_CHECK_LIB(igemacintegration, ige_mac_menu_set_menu_bar,
1792 AC_DEFINE(HAVE_IGE_MAC_INTEGRATION, 1,
1793 [Define to 1 if the the Gtk+ framework or a separate library includes the Imendio IGE Mac OS X Integration functions.])
1795 # We don't want gtk stuff in LIBS (which is reset below) so
1796 # manually set GTK_LIBS (which is more appropriate)
1797 GTK_LIBS="$GTK_LIBS -ligemacintegration"
1800 CFLAGS="$ac_save_CFLAGS"
1801 LIBS="$ac_save_LIBS"
1805 # AC_WIRESHARK_PYTHON_CHECK
1807 # Check whether python devel package is present
1809 AC_DEFUN([AC_WIRESHARK_PYTHON_CHECK],
1812 # Checking whether we have a python devel environment available
1814 # AC_CACHE_CHECK([checking python devel package], ac_cv_wireshark_python_devel,
1816 AC_CHECK_PROG([ac_ws_python_config], python-config, "yes", "no")
1817 if test "x$ac_ws_python_config" = "xno"; then
1818 ac_cv_wireshark_python_devel=no
1819 if test "x$want_python" = "xyes"
1822 # The user tried to force us to use Python, but we
1823 # couldn't find the python-config tool; report an error.
1825 AC_MSG_ERROR("python-config not found")
1828 # Set want_python to no, so we report that we aren't using
1829 # the Python interpreter.
1833 AC_MSG_CHECKING([python devel])
1834 ac_save_ws_cflags=$CFLAGS
1835 ac_save_ws_libs=$LIBS
1836 CFLAGS=$(python-config --includes)
1837 LIBS=$(python-config --ldflags)
1841 [[#include <Python.h>]],
1842 [[Py_Initialiaze();]]
1847 # Compilation successful, we have python devel available
1849 ac_cv_wireshark_python_devel=yes
1854 CFLAGS="$ac_save_ws_cflags"
1855 LIBS="$ac_save_ws_libs"
1856 AC_DEFINE(HAVE_PYTHON, 1, [Define if python devel package available])
1857 AC_MSG_RESULT([yes])
1861 # Compilation unsuccessful, python devel not available
1863 ac_cv_wireshark_python_devel=no
1864 CFLAGS=$ac_save_ws_cflags
1865 LIBS=$ac_save_ws_libs
1866 if test "x$want_python" = "xyes"
1869 # The user tried to force us to use Python, but we
1870 # couldn't compile the test program; report an error.
1872 AC_MSG_ERROR("Python test program failed compilation")
1876 # Set want_python to no, so we report that we aren't using
1877 # the Python interpreter.