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],
74 # AC_WIRESHARK_STRUCT_SA_LEN
76 dnl AC_STRUCT_ST_BLKSIZE extracted from the file in question,
77 dnl "acspecific.m4" in GNU Autoconf 2.12, and turned into
78 dnl AC_WIRESHARK_STRUCT_SA_LEN, which checks if "struct sockaddr"
79 dnl has the 4.4BSD "sa_len" member, and defines HAVE_SA_LEN; that's
80 dnl what's in this file.
81 dnl Done by Guy Harris <guy@alum.mit.edu> on 1998-11-14.
83 dnl ### Checks for structure members
85 AC_DEFUN([AC_WIRESHARK_STRUCT_SA_LEN],
86 [AC_CACHE_CHECK([for sa_len in struct sockaddr], ac_cv_wireshark_struct_sa_len,
87 [AC_TRY_COMPILE([#include <sys/types.h>
88 #include <sys/socket.h>], [struct sockaddr s; s.sa_len;],
89 ac_cv_wireshark_struct_sa_len=yes, ac_cv_wireshark_struct_sa_len=no)])
90 if test $ac_cv_wireshark_struct_sa_len = yes; then
91 AC_DEFINE(HAVE_SA_LEN, 1, [Define if sa_len field exists in struct sockaddr])
97 dnl Check whether a given format can be used to print 64-bit integers
99 AC_DEFUN([AC_WIRESHARK_CHECK_64BIT_FORMAT],
101 AC_MSG_CHECKING([whether %$1x can be used to format 64-bit integers])
106 # ifdef HAVE_INTTYPES_H
107 #include <inttypes.h>
109 #include <glibconfig.h>
111 #include <sys/types.h>
117 sprintf(strbuf, "%016$1x", t << 32);
118 if (strcmp(strbuf, "0000000100000000") == 0)
126 AC_DEFINE(PRId64, "$1d", [Format for printing 64-bit signed decimal numbers])
127 AC_DEFINE(PRIo64, "$1o", [Format for printing 64-bit unsigned octal numbers])
128 AC_DEFINE(PRIx64, "$1x", [Format for printing 64-bit unsigned hexadecimal numbers (lower-case)])
129 AC_DEFINE(PRIX64, "$1X", [Format for printing 64-bit unsigned hexadecimal numbers (upper-case)])
130 AC_DEFINE(PRIu64, "$1u", [Format for printing 64-bit unsigned decimal numbers])
140 # AC_WIRESHARK_IPV6_STACK
142 # By Jun-ichiro "itojun" Hagino, <itojun@iijlab.net>
144 AC_DEFUN([AC_WIRESHARK_IPV6_STACK],
149 AC_MSG_CHECKING([ipv6 stack type])
150 for i in v6d toshiba kame inria zeta linux linux-glibc solaris8; do
154 #include </usr/local/v6/include/sys/types.h>
158 [v6type=$i; v6lib=v6;
159 v6libdir=/usr/local/v6/lib;
160 CFLAGS="-I/usr/local/v6/include $CFLAGS"])
164 #include <sys/param.h>
165 #ifdef _TOSHIBA_INET6
168 [v6type=$i; v6lib=inet6;
169 v6libdir=/usr/local/v6/lib;
170 CFLAGS="-DINET6 $CFLAGS"])
174 #include <netinet/in.h>
178 [v6type=$i; v6lib=inet6;
179 v6libdir=/usr/local/v6/lib;
180 CFLAGS="-DINET6 $CFLAGS"])
184 #include <netinet/in.h>
185 #ifdef IPV6_INRIA_VERSION
188 [v6type=$i; CFLAGS="-DINET6 $CFLAGS"])
192 #include <sys/param.h>
193 #ifdef _ZETA_MINAMI_INET6
196 [v6type=$i; v6lib=inet6;
197 v6libdir=/usr/local/v6/lib;
198 CFLAGS="-DINET6 $CFLAGS"])
201 if test -d /usr/inet6; then
205 CFLAGS="-DINET6 $CFLAGS"
210 #include <features.h>
211 #if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
212 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || __GLIBC__ > 2
216 [v6type=$i; v6lib=inet6; CFLAGS="-DINET6 $CFLAGS"])
219 if test "`uname -s`" = "SunOS" && test "`uname -r`" = "5.8"; then
222 [CFLAGS="-DINET6 -DSOLARIS8_INET6 $CFLAGS"]
226 if test "$v6type" != "unknown"; then
231 if test "$v6lib" != "none"; then
232 for dir in $v6libdir /usr/local/v6/lib /usr/local/lib; do
233 if test -d $dir -a -f $dir/lib$v6lib.a; then
234 LIBS="-L$dir $LIBS -l$v6lib"
242 AC_MSG_RESULT(["$v6type, $v6lib"])
246 # AC_WIRESHARK_GETHOSTBY_LIB_CHECK
248 # Checks whether we need "-lnsl" to get "gethostby*()", which we use
251 # Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
252 # GNU Autoconf 2.13; the comment came from there.
253 # Done by Guy Harris <guy@alum.mit.edu> on 2000-01-14.
255 AC_DEFUN([AC_WIRESHARK_GETHOSTBY_LIB_CHECK],
257 # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
258 # to get the SysV transport functions.
259 # chad@anasazi.com says the Pyramid MIS-ES running DC/OSx (SVR4)
261 # The nsl library prevents programs from opening the X display
262 # on Irix 5.2, according to dickey@clark.net.
263 AC_CHECK_FUNC(gethostbyname, ,
264 AC_CHECK_LIB(nsl, gethostbyname, NSL_LIBS="-lnsl"))
269 # AC_WIRESHARK_SOCKET_LIB_CHECK
271 # Checks whether we need "-lsocket" to get "socket()", which is used
272 # by libpcap on some platforms - and, in effect, "gethostby*()" on
273 # most if not all platforms (so that it can use NIS or DNS or...
274 # to look up host names).
276 # Adapted from stuff in the AC_PATH_XTRA macro in "acspecific.m4" in
277 # GNU Autoconf 2.13; the comment came from there.
278 # Done by Guy Harris <guy@alum.mit.edu> on 2000-01-14.
280 # We use "connect" because that's what AC_PATH_XTRA did.
282 AC_DEFUN([AC_WIRESHARK_SOCKET_LIB_CHECK],
284 # lieder@skyler.mavd.honeywell.com says without -lsocket,
285 # socket/setsockopt and other routines are undefined under SCO ODT
286 # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
287 # on later versions), says simon@lia.di.epfl.ch: it contains
288 # gethostby* variants that don't use the nameserver (or something).
289 # -lsocket must be given before -lnsl if both are needed.
290 # We assume that if connect needs -lnsl, so does gethostbyname.
291 AC_CHECK_FUNC(connect, ,
292 AC_CHECK_LIB(socket, connect, SOCKET_LIBS="-lsocket",
293 AC_MSG_ERROR(Function 'socket' not found.), $NSL_LIBS))
294 AC_SUBST(SOCKET_LIBS)
298 # AC_WIRESHARK_BREAKLOOP_TRY_LINK
300 AC_DEFUN([AC_WIRESHARK_PCAP_BREAKLOOP_TRY_LINK],
316 ws_breakloop_compiled=yes
319 ws_breakloop_compiled=no
326 # AC_WIRESHARK_PCAP_CHECK
328 AC_DEFUN([AC_WIRESHARK_PCAP_CHECK],
330 if test -z "$pcap_dir"
333 # XXX need to set a var AC_CHECK_HEADER(pcap.h,,)
336 # The user didn't specify a directory in which libpcap resides;
337 # we assume that the current library search path will work,
338 # but we may have to look for the header in a "pcap"
339 # subdirectory of "/usr/include" or "/usr/local/include",
340 # as some systems apparently put "pcap.h" in a "pcap"
341 # subdirectory, and we also check "$prefix/include" - and
342 # "$prefix/include/pcap", in case $prefix is set to
343 # "/usr/include" or "/usr/local/include".
345 # XXX - should we just add "$prefix/include" to the include
346 # search path and "$prefix/lib" to the library search path?
348 AC_MSG_CHECKING(for extraneous pcap header directories)
350 pcap_dir_list="/usr/include/pcap $prefix/include/pcap $prefix/include"
351 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
352 pcap_dir_list="$pcap_dir_list /usr/local/include/pcap"
354 for pcap_dir in $pcap_dir_list
356 if test -d $pcap_dir ; then
357 if test x$pcap_dir != x/usr/include -a x$pcap_dir != x/usr/local/include ; then
358 CFLAGS="$CFLAGS -I$pcap_dir"
359 CPPFLAGS="$CPPFLAGS -I$pcap_dir"
361 found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
366 if test "$found_pcap_dir" != "" ; then
367 AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
369 AC_MSG_RESULT(not found)
373 # The user specified a directory in which libpcap resides,
374 # so add the "include" subdirectory of that directory to
375 # the include file search path and the "lib" subdirectory
376 # of that directory to the library search path.
378 # XXX - if there's also a libpcap in a directory that's
379 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
380 # make us find the version in the specified directory,
381 # as the compiler and/or linker will search that other
382 # directory before it searches the specified directory.
384 CFLAGS="$CFLAGS -I$pcap_dir/include"
385 CPPFLAGS="$CPPFLAGS -I$pcap_dir/include"
386 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, $pcap_dir/lib)
390 AC_CHECK_HEADER(pcap.h,,
391 AC_MSG_ERROR([[Header file pcap.h not found; if you installed libpcap
392 from source, did you also do \"make install-incl\", and if you installed a
393 binary package of libpcap, is there also a developer's package of libpcap,
394 and did you also install that package?]]))
397 # Check to see if we find "pcap_open_live" in "-lpcap".
398 # Also check for various additional libraries that libpcap might
401 AC_CHECK_LIB(pcap, pcap_open_live,
404 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
406 ac_wireshark_extras_found=no
408 for extras in "-lcfg -lodm" "-lpfring"
410 AC_MSG_CHECKING([for pcap_open_live in -lpcap with $extras])
411 LIBS="-lpcap $extras"
413 # XXX - can't we use AC_CHECK_LIB here?
420 pcap_open_live(NULL, 0, 0, 0, NULL);
423 ac_wireshark_extras_found=yes
425 PCAP_LIBS="-lpcap $extras"
426 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
431 if test x$ac_wireshark_extras_found = xyes
436 if test x$ac_wireshark_extras_found = xno
438 AC_MSG_ERROR([Can't link with library libpcap.])
441 ], $SOCKET_LIBS $NSL_LIBS)
445 # Check whether various variables and functions are defined by
449 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
450 LIBS="$PCAP_LIBS $SOCKET_LIBS $NSL_LIBS $LIBS"
454 extern char *pcap_version;
457 printf ("%s\n", pcap_version);
459 ac_cv_pcap_version_defined=yes,
460 ac_cv_pcap_version_defined=no,
461 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
462 if test "$ac_cv_pcap_version_defined" = yes ; then
464 AC_DEFINE(HAVE_PCAP_VERSION, 1, [Define if libpcap version is known])
468 AC_CHECK_FUNCS(pcap_open_dead pcap_freecode)
470 # pcap_breakloop may be present in the library and not declared in the
471 # header file. We are therefore testing whether the function is present
472 # first and then if it is usable. It is usable if it compiles without
473 # an implicit warning. If it is not usable, we output a warning telling
474 # the user to update his pcap header.
476 # Ceteris paribus, it should only happen with Mac OS X 10.3[.x] which
477 # can have an up-to-date pcap library without the corresponding pcap
480 # However, it might also happen on some others OSes with some erroneous
481 # system manipulations where multiple versions of libcap might co-exist
482 # e.g. hand made symbolic link from libpcap.so -> libpcap.so.0.8 but
483 # having the pcap header version 0.7.
485 AC_MSG_CHECKING([whether pcap_breakloop is present and usable])
486 ac_CFLAGS_saved="$CFLAGS"
487 AC_WIRESHARK_PCAP_BREAKLOOP_TRY_LINK
488 if test "x$ws_breakloop_compiled" = "xyes"; then
489 CFLAGS="$CFLAGS -Werror -Wimplicit"
490 AC_WIRESHARK_PCAP_BREAKLOOP_TRY_LINK
491 if test "x$ws_breakloop_compiled" = "xyes"; then
493 AC_DEFINE(HAVE_PCAP_BREAKLOOP, 1, [Define if pcap_breakloop is known])
495 AC_MSG_RESULT(broken)
496 AC_MSG_WARN([Your pcap library is more recent than your pcap header.])
497 AC_MSG_WARN([Wireshark won't be able to use functions not declared])
498 AC_MSG_WARN([in that header. You should install a newer version of])
499 AC_MSG_WARN([the header file.])
501 CFLAGS="$ac_CFLAGS_saved"
503 AC_MSG_RESULT(function not present)
507 # Later versions of Mac OS X 10.3[.x] ship a pcap.h that
508 # doesn't define pcap_if_t but ship an 0.8[.x] libpcap,
509 # so the library has "pcap_findalldevs()", but pcap.h
510 # doesn't define "pcap_if_t" so you can't actually *use*
511 # "pcap_findalldevs()".
513 # That even appears to be true of systems shipped with
514 # 10.3.4, so it doesn't appear only to be a case of
515 # Software Update not updating header files.
517 # (You can work around this by installing the 0.8 header
520 AC_CACHE_CHECK([whether pcap_findalldevs is present and usable],
521 [ac_cv_func_pcap_findalldevs],
530 pcap_if_t *devpointer;
533 pcap_findalldevs(&devpointer, errbuf);
538 ac_cv_func_pcap_findalldevs=yes
541 ac_cv_func_pcap_findalldevs=no
545 # Don't check for other new routines that showed up after
546 # "pcap_findalldevs()" if we don't have a usable
547 # "pcap_findalldevs()", so we don't end up using them if the
548 # "pcap.h" is crufty and old and doesn't declare them.
550 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
551 AC_DEFINE(HAVE_PCAP_FINDALLDEVS, 1,
552 [Define to 1 if you have the `pcap_findalldevs' function and a pcap.h that declares pcap_if_t.])
553 AC_CHECK_FUNCS(pcap_datalink_val_to_name pcap_datalink_name_to_val)
554 AC_CHECK_FUNCS(pcap_list_datalinks pcap_set_datalink pcap_lib_version)
555 AC_CHECK_FUNCS(pcap_get_selectable_fd)
560 AC_DEFUN([AC_WIRESHARK_PCAP_REMOTE_CHECK],
563 LIBS="$PCAP_LIBS $SOCKET_LIBS $NSL_LIBS $LIBS"
564 AC_DEFINE(HAVE_REMOTE, 1, [Define to 1 to enable remote
565 capturing feature in WinPcap library])
566 AC_CHECK_FUNCS(pcap_open pcap_findalldevs_ex pcap_createsrcstr)
567 if test $ac_cv_func_pcap_open = "yes" -a \
568 $ac_cv_func_pcap_findalldevs_ex = "yes" -a \
569 $ac_cv_func_pcap_createsrcstr = "yes" ; then
570 AC_DEFINE(HAVE_PCAP_REMOTE, 1,
571 [Define to 1 if you have WinPcap remote capturing support and prefer to use these new API features.])
573 AC_CHECK_FUNCS(pcap_setsampling)
578 # AC_WIRESHARK_ZLIB_CHECK
580 AC_DEFUN([AC_WIRESHARK_ZLIB_CHECK],
582 if test "x$zlib_dir" != "x"
585 # The user specified a directory in which zlib resides,
586 # so add the "include" subdirectory of that directory to
587 # the include file search path and the "lib" subdirectory
588 # of that directory to the library search path.
590 # XXX - if there's also a zlib in a directory that's
591 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
592 # make us find the version in the specified directory,
593 # as the compiler and/or linker will search that other
594 # directory before it searches the specified directory.
596 wireshark_save_CFLAGS="$CFLAGS"
597 CFLAGS="$CFLAGS -I$zlib_dir/include"
598 wireshark_save_CPPFLAGS="$CPPFLAGS"
599 CPPFLAGS="$CPPFLAGS -I$zlib_dir/include"
600 wireshark_save_LIBS="$LIBS"
601 AC_WIRESHARK_ADD_DASH_L(LIBS, $zlib_dir/lib)
605 # Make sure we have "zlib.h". If we don't, it means we probably
606 # don't have zlib, so don't use it.
608 AC_CHECK_HEADER(zlib.h,,
610 if test "x$zlib_dir" != "x"
613 # The user used "--with-zlib=" to specify a directory
614 # containing zlib, but we didn't find the header file
615 # there; that either means they didn't specify the
616 # right directory or are confused about whether zlib
617 # is, in fact, installed. Report the error and give up.
619 AC_MSG_ERROR([zlib header not found in directory specified in --with-zlib])
621 if test "x$want_zlib" = "xyes"
624 # The user tried to force us to use the library, but we
625 # couldn't find the header file; report an error.
627 AC_MSG_ERROR(Header file zlib.h not found.)
630 # We couldn't find the header file; don't use the
631 # library, as it's probably not present.
638 if test "x$want_zlib" != "xno"
641 # Well, we at least have the zlib header file.
643 # Check for "gzgets()" in zlib, because we need it, but
644 # some older versions of zlib don't have it. It appears
645 # from the zlib ChangeLog that any released version of zlib
646 # with "gzgets()" should have the other routines we
647 # depend on, such as "gzseek()", "gztell()", and "zError()".
649 # Another reason why we require "gzgets()" is that
650 # some versions of zlib that didn't have it, such
651 # as 1.0.8, had a bug in "gzseek()" that meant that it
652 # doesn't work correctly on uncompressed files; this
653 # means we cannot use version 1.0.8. (Unfortunately,
654 # that's the version that comes with recent X11 source,
655 # and many people who install XFree86 on their Slackware
656 # boxes don't realize that they should configure it to
657 # use the native zlib rather than building and installing
658 # the crappy old version that comes with XFree86.)
660 # I.e., we can't just avoid using "gzgets()", as
661 # versions of zlib without "gzgets()" are likely to have
662 # a broken "gzseek()".
664 AC_CHECK_LIB(z, gzgets,
666 if test "x$zlib_dir" != "x"
669 # Put the "-I" and "-L" flags for zlib at
670 # the beginning of CFLAGS, CPPFLAGS, and
674 AC_WIRESHARK_ADD_DASH_L(LIBS, $zlib_dir/lib)
675 LIBS="$LIBS -lz $wireshark_save_LIBS"
679 AC_DEFINE(HAVE_LIBZ, 1, [Define to use libz library])
681 if test "x$zlib_dir" != "x"
684 # Restore the versions of CFLAGS, CPPFLAGS,
685 # and LIBS before we added the "-with-zlib="
686 # directory, as we didn't actually find
687 # zlib there, or didn't find a zlib that
688 # contains gzgets there.
690 CFLAGS="$wireshark_save_CFLAGS"
691 CPPFLAGS="$wireshark_save_CPPFLAGS"
692 LIBS="$wireshark_save_LIBS"
698 if test "x$want_zlib" != "xno"
701 # Well, we at least have the zlib header file and a zlib
704 # Now check for "gzgets()" in zlib when linking with the
705 # linker flags for GTK+ applications; people often grab
706 # XFree86 source and build and install it on their systems,
707 # and they appear sometimes to misconfigure XFree86 so that,
708 # even on systems with zlib, it assumes there is no zlib,
709 # so the XFree86 build process builds and installs its
710 # own zlib in the X11 library directory.
712 # The XFree86 zlib is an older version that lacks
713 # "gzgets()", and that's the zlib with which Wireshark
714 # gets linked, so the build of Wireshark fails.
716 ac_save_CFLAGS="$CFLAGS"
718 CFLAGS="$CFLAGS $GTK_CFLAGS"
719 LIBS="$GTK_LIBS -lz $LIBS"
720 AC_MSG_CHECKING([for gzgets missing when linking with X11])
721 AC_TRY_LINK_FUNC(gzgets, AC_MSG_RESULT(no),
724 AC_MSG_ERROR(old zlib found when linking with X11 - get rid of old zlib.)
726 CFLAGS="$ac_save_CFLAGS"
732 # AC_WIRESHARK_LIBPCRE_CHECK
734 AC_DEFUN([AC_WIRESHARK_LIBPCRE_CHECK],
736 if test "x$pcre_dir" != "x"
739 # The user specified a directory in which libpcre resides,
740 # so add the "include" subdirectory of that directory to
741 # the include file search path and the "lib" subdirectory
742 # of that directory to the library search path.
744 # XXX - if there's also a libpcre in a directory that's
745 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
746 # make us find the version in the specified directory,
747 # as the compiler and/or linker will search that other
748 # directory before it searches the specified directory.
750 wireshark_save_CFLAGS="$CFLAGS"
751 CFLAGS="$CFLAGS -I$pcre_dir/include"
752 wireshark_save_CPPFLAGS="$CPPFLAGS"
753 CPPFLAGS="$CPPFLAGS -I$pcre_dir/include"
754 wireshark_save_LIBS="$LIBS"
756 wireshark_save_LDFLAGS="$LDFLAGS"
757 LDFLAGS="$LDFLAGS -L$pcre_dir/lib"
761 # Make sure we have "pcre.h". If we don't, it means we probably
762 # don't have libpcre, so don't use it.
764 AC_CHECK_HEADER(pcre.h,,
766 if test "x$pcre_dir" != "x"
769 # The user used "--with-pcre=" to specify a directory
770 # containing libpcre, but we didn't find the header file
771 # there; that either means they didn't specify the
772 # right directory or are confused about whether libpcre
773 # is, in fact, installed. Report the error and give up.
775 AC_MSG_ERROR([libpcre header not found in directory specified in --with-pcre])
777 if test "x$want_pcre" = "xyes"
780 # The user tried to force us to use the library, but we
781 # couldn't find the header file; report an error.
783 AC_MSG_ERROR(Header file pcre.h not found.)
786 # We couldn't find the header file; don't use the
787 # library, as it's probably not present.
794 if test "x$want_pcre" != "xno"
797 # Well, we at least have the pcre header file.
799 # We're only using standard functions from libpcre,
800 # so we don't need to perform extra checks.
802 AC_CHECK_LIB(pcre, pcre_compile,
804 if test "x$pcre_dir" != "x"
807 # Put the "-I" and "-L" flags for pcre at
808 # the beginning of CFLAGS, CPPFLAGS,
811 PCRE_LIBS="-L$pcre_dir/lib -lpcre $wireshark_save_LIBS"
815 AC_DEFINE(HAVE_LIBPCRE, 1, [Define to use libpcre library])
817 if test "x$pcre_dir" != "x"
820 # Restore the versions of CFLAGS, CPPFLAGS,
821 # LDFLAGS, and LIBS before we added the
822 # "--with-pcre=" directory, as we didn't
823 # actually find pcre there.
825 CFLAGS="$wireshark_save_CFLAGS"
826 CPPFLAGS="$wireshark_save_CPPFLAGS"
827 LDFLAGS="$wireshark_save_LDFLAGS"
828 LIBS="$wireshark_save_LIBS"
838 # AC_WIRESHARK_LIBLUA_CHECK
840 AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
842 if test "x$lua_dir" != "x"
845 # The user specified a directory in which liblua resides,
846 # so add the "include" subdirectory of that directory to
847 # the include file search path and the "lib" subdirectory
848 # of that directory to the library search path.
850 # XXX - if there's also a liblua in a directory that's
851 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
852 # make us find the version in the specified directory,
853 # as the compiler and/or linker will search that other
854 # directory before it searches the specified directory.
856 wireshark_save_CFLAGS="$CFLAGS"
857 CFLAGS="$CFLAGS -I$lua_dir/include"
858 wireshark_save_CPPFLAGS="$CPPFLAGS"
859 CPPFLAGS="$CPPFLAGS -I$lua_dir/include"
860 wireshark_save_LIBS="$LIBS"
861 LIBS="$LIBS -L$lua_dir/lib -llua -lm"
862 wireshark_save_LDFLAGS="$LDFLAGS"
863 LDFLAGS="$LDFLAGS -L$lua_dir/lib"
866 # The user specified no directory in which liblua resides,
867 # so just add "-llua -lliblua" to the used libs.
869 wireshark_save_CFLAGS="$CFLAGS"
870 wireshark_save_CPPFLAGS="$CPPFLAGS"
871 wireshark_save_LDFLAGS="$LDFLAGS"
872 wireshark_save_LIBS="$LIBS"
873 LIBS="$LIBS -llua -lm"
877 # Make sure we have "lua.h", "lualib.h" and "lauxlib.h". If we don't, it means we probably
878 # don't have liblua, so don't use it.
880 AC_CHECK_HEADERS(lua.h lualib.h lauxlib.h,,
882 AC_CHECK_HEADERS(lua5.1/lua.h lua5.1/lualib.h lua5.1/lauxlib.h,
884 if test "x$lua_dir" != "x"
886 LUA_INCLUDES="-I$lua_dir/include/lua5.1"
888 # we found lua5.1/lua.h, but we don't know which include dir contains it
889 AC_MSG_ERROR(Header file lua.h was found as lua5.1/lua.h but we can't use it. Please set the PATH for the --with-lua configure parameter. \n probably it is /usr.)
894 if test "x$lua_dir" != "x"
897 # The user used "--with-lua=" to specify a directory
898 # containing liblua, but we didn't find the header file
899 # there; that either means they didn't specify the
900 # right directory or are confused about whether liblua
901 # is, in fact, installed. Report the error and give up.
903 AC_MSG_ERROR([liblua header not found in directory specified in --with-lua])
905 if test "x$want_lua" = "xyes"
908 # The user tried to force us to use the library, but we
909 # couldn't find the header file; report an error.
911 AC_MSG_ERROR(Header file lua.h not found.)
914 # We couldn't find the header file; don't use the
915 # library, as it's probably not present.
923 if test "x$want_lua" != "xno"
926 # Well, we at least have the lua header file.
928 # let's check if the libs are there
931 # At least on Suse 9.3 systems, liblualib needs linking
933 LIBS="$LIBS $LUA_LIBS -lm"
935 AC_CHECK_LIB(lua, lua_call,
937 if test "x$lua_dir" != "x"
940 # Put the "-I" and "-L" flags for lua at
941 # the beginning of CFLAGS, CPPFLAGS,
944 LUA_LIBS="-L$lua_dir/lib -llua -lm"
945 LUA_INCLUDES="-I$lua_dir/include"
952 # we got lua, now look for lualib
954 AC_CHECK_LIB(lualib, luaL_openlib,
959 LUA_LIBS="$LUA_LIBS -llualib"
962 # no lualib, in 5.1 there's only liblua
966 LIBS="$wireshark_save_LIBS $LUA_LIBS"
968 AC_CHECK_LIB(lua, luaL_register,
973 AC_DEFINE(HAVE_LUA_5_1, 1, [Define to use Lua 5.1])
978 if test "x$lua_dir" != "x"
981 # Restore the versions of CFLAGS, CPPFLAGS,
982 # LDFLAGS, and LIBS before we added the
983 # "--with-lua=" directory, as we didn't
984 # actually find lua there.
986 CFLAGS="$wireshark_save_CFLAGS"
987 CPPFLAGS="$wireshark_save_CPPFLAGS"
988 LDFLAGS="$wireshark_save_LDFLAGS"
989 LIBS="$wireshark_save_LIBS"
992 # User requested --with-lua but it isn't available
993 if test "x$want_lua" = "xyes"
995 AC_MSG_ERROR(Linking with liblualib failed.)
1002 # We could not find the libs, maybe we have version number in the lib name
1005 LIBS="$wireshark_save_LIBS -llua5.1 -lm"
1007 AC_CHECK_LIB(lua5.1, luaL_register,
1012 AC_DEFINE(HAVE_LUA_5_1, 1, [Define to use Lua 5.1])
1013 LUA_LIBS=" -llua5.1 -lm"
1016 # Restore the versions of CFLAGS, CPPFLAGS,
1017 # LDFLAGS, and LIBS before we added the
1018 # "--with-lua=" directory, as we didn't
1019 # actually find lua there.
1021 CFLAGS="$wireshark_save_CFLAGS"
1022 CPPFLAGS="$wireshark_save_CPPFLAGS"
1023 LDFLAGS="$wireshark_save_LDFLAGS"
1024 LIBS="$wireshark_save_LIBS"
1026 # User requested --with-lua but it isn't available
1027 if test "x$want_lua" = "xyes"
1029 AC_MSG_ERROR(Linking with liblua failed.)
1035 CFLAGS="$wireshark_save_CFLAGS"
1036 CPPFLAGS="$wireshark_save_CPPFLAGS"
1037 LDFLAGS="$wireshark_save_LDFLAGS"
1038 LIBS="$wireshark_save_LIBS"
1040 AC_SUBST(LUA_INCLUDES)
1046 # AC_WIRESHARK_LIBPORTAUDIO_CHECK
1048 AC_DEFUN([AC_WIRESHARK_LIBPORTAUDIO_CHECK],[
1050 if test "x$portaudio_dir" != "x"
1053 # The user specified a directory in which libportaudio
1054 # resides, so add the "include" subdirectory of that directory to
1055 # the include file search path and the "lib" subdirectory
1056 # of that directory to the library search path.
1058 # XXX - if there's also a libportaudio in a directory that's
1059 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
1060 # make us find the version in the specified directory,
1061 # as the compiler and/or linker will search that other
1062 # directory before it searches the specified directory.
1064 wireshark_save_CFLAGS="$CFLAGS"
1065 CFLAGS="$CFLAGS -I$portaudio_dir/include"
1066 wireshark_save_CPPFLAGS="$CPPFLAGS"
1067 CPPFLAGS="$CPPFLAGS -I$portaudio_dir/include"
1068 wireshark_save_LIBS="$LIBS"
1069 LIBS="$LIBS -L$portaudio_dir/lib -lportaudio"
1070 wireshark_save_LDFLAGS="$LDFLAGS"
1071 LDFLAGS="$LDFLAGS -L$portaudio_dir/lib"
1074 # The user specified no directory in which libportaudio resides,
1075 # so just add "-lportaudio" to the used libs.
1077 wireshark_save_CFLAGS="$CFLAGS"
1078 wireshark_save_CPPFLAGS="$CPPFLAGS"
1079 wireshark_save_LDFLAGS="$LDFLAGS"
1080 wireshark_save_LIBS="$LIBS"
1081 LIBS="$LIBS -lportaudio"
1085 # Make sure we have "portaudio.h". If we don't, it means we probably
1086 # don't have libportaudio, so don't use it.
1088 AC_CHECK_HEADERS(portaudio.h,,
1090 if test "x$portaudio_dir" != "x"
1093 # The user used "--with-portaudio=" to specify a directory
1094 # containing libportaudio, but we didn't find the header file
1095 # there; that either means they didn't specify the
1096 # right directory or are confused about whether libportaudio
1097 # is, in fact, installed. Report the error and give up.
1099 AC_MSG_ERROR([libportaudio header not found in directory specified in --with-portaudio])
1101 CFLAGS="$wireshark_save_CFLAGS"
1102 CPPFLAGS="$wireshark_save_CPPFLAGS"
1103 LDFLAGS="$wireshark_save_LDFLAGS"
1104 LIBS="$wireshark_save_LIBS"
1106 if test "x$want_portaudio" = "xyes"
1109 # The user tried to force us to use the library, but we
1110 # couldn't find the header file; report an error.
1112 AC_MSG_ERROR(Header file portaudio.h not found.)
1115 # We couldn't find the header file; don't use the
1116 # library, as it's probably not present.
1124 # Check whether we have the right version of portaudio
1126 if test "x$want_portaudio" != "xno"
1128 AC_CHECK_TYPE(PortAudioStream,
1129 AC_DEFINE(PORTAUDIO_API_1, 1, [Define if we are using version of of the Portaudio library API]),
1131 [#include <portaudio.h>])
1134 if test "x$want_portaudio" != "xno"
1137 # Well, we at least have the portaudio header file.
1139 # let's check if the libs are there
1142 AC_CHECK_LIB(portaudio, Pa_Initialize,
1144 if test "x$portaudio_dir" != "x"
1147 # Put the "-I" and "-L" flags for portaudio at
1148 # the beginning of CFLAGS, CPPFLAGS,
1149 # LDFLAGS, and LIBS.
1151 PORTAUDIO_LIBS="-L$portaudio_dir/lib -lportaudio"
1152 PORTAUDIO_INCLUDES="-I$portaudio_dir/include"
1154 PORTAUDIO_LIBS="-lportaudio"
1155 PORTAUDIO_INCLUDES=""
1157 AC_DEFINE(HAVE_LIBPORTAUDIO, 1, [Define to use libportaudio library])
1161 # Restore the versions of CFLAGS, CPPFLAGS,
1162 # LDFLAGS, and LIBS before we added the
1163 # "--with-portaudio=" directory, as we didn't
1164 # actually find portaudio there.
1166 CFLAGS="$wireshark_save_CFLAGS"
1167 CPPFLAGS="$wireshark_save_CPPFLAGS"
1168 LDFLAGS="$wireshark_save_LDFLAGS"
1169 LIBS="$wireshark_save_LIBS"
1171 # User requested --with-portaudio but it isn't available
1172 if test "x$want_portaudio" = "xyes"
1174 AC_MSG_ERROR(Linking with libportaudio failed.)
1179 CFLAGS="$wireshark_save_CFLAGS"
1180 CPPFLAGS="$wireshark_save_CPPFLAGS"
1181 LDFLAGS="$wireshark_save_LDFLAGS"
1182 LIBS="$wireshark_save_LIBS"
1183 AC_SUBST(PORTAUDIO_LIBS)
1184 AC_SUBST(PORTAUDIO_INCLUDES)
1190 # AC_WIRESHARK_RPM_CHECK
1191 # Looks for the rpm program, and checks to see if we can redefine "_topdir".
1193 AC_DEFUN([AC_WIRESHARK_RPM_CHECK],
1195 AC_CHECK_PROG(ac_cv_wireshark_have_rpm, rpm, "yes", "no")
1196 if test "x$ac_cv_wireshark_have_rpm" = "xyes"; then
1197 rpm --define '_topdir /tmp' > /dev/null 2>&1
1198 AC_MSG_CHECKING(to see if we can redefine _topdir)
1199 if test $? -eq 0 ; then
1203 AC_MSG_RESULT(no. You'll have to build packages manually.)
1210 # AC_WIRESHARK_GNU_SED_CHECK
1211 # Checks if GNU sed is the first sed in PATH.
1213 AC_DEFUN([AC_WIRESHARK_GNU_SED_CHECK],
1215 AC_MSG_CHECKING(for GNU sed as first sed in PATH)
1216 if ( sh -c "sed --version" </dev/null 2> /dev/null | grep "GNU sed" 2>&1 > /dev/null ) ; then
1226 # AC_WIRESHARK_ADNS_CHECK
1228 AC_DEFUN([AC_WIRESHARK_ADNS_CHECK],
1230 want_adns=defaultyes
1232 if test "x$want_adns" = "xdefaultyes"; then
1234 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1236 if test -d "$withval"; then
1237 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1242 if test "x$want_adns" = "xyes"; then
1243 AC_CHECK_LIB(adns, adns_init,
1246 AC_DEFINE(HAVE_GNU_ADNS, 1, [Define to use GNU ADNS library])
1248 ],, $SOCKET_LIBS $NSL_LIBS
1251 AC_MSG_RESULT(not required)
1257 # AC_WIRESHARK_LIBCAP_CHECK
1259 AC_DEFUN([AC_WIRESHARK_LIBCAP_CHECK],
1261 want_libcap=defaultyes
1263 if test "x$want_libcap" = "xdefaultyes"; then
1265 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
1267 if test -d "$withval"; then
1268 AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1273 if test "x$want_libcap" = "xyes"; then
1274 AC_CHECK_LIB(cap, cap_set_flag,
1277 AC_DEFINE(HAVE_LIBCAP, 1, [Define to use the libcap library])
1278 have_good_libcap=yes
1282 AC_MSG_RESULT(not required)
1288 # AC_WIRESHARK_KRB5_CHECK
1290 AC_DEFUN([AC_WIRESHARK_KRB5_CHECK],
1292 wireshark_save_CFLAGS="$CFLAGS"
1293 wireshark_save_CPPFLAGS="$CPPFLAGS"
1294 if test "x$krb5_dir" != "x"
1297 # The user specified a directory in which kerberos resides,
1298 # so add the "include" subdirectory of that directory to
1299 # the include file search path and the "lib" subdirectory
1300 # of that directory to the library search path.
1302 # XXX - if there's also a kerberos in a directory that's
1303 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
1304 # make us find the version in the specified directory,
1305 # as the compiler and/or linker will search that other
1306 # directory before it searches the specified directory.
1308 CFLAGS="$CFLAGS -I$krb5_dir/include"
1309 CPPFLAGS="$CPPFLAGS -I$krb5_dir/include"
1310 ac_heimdal_version=`grep heimdal $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/'`
1311 ac_mit_version=`grep 'Massachusetts Institute of Technology' $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*Massachusetts Institute of Technology.*$/MIT/'`
1312 ac_krb5_version="$ac_heimdal_version$ac_mit_version"
1313 if test "x$ac_krb5_version" = "xHEIMDAL"
1314 KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lasn1 $SSL_LIBS -lroken -lcrypt"
1316 KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lk5crypto -lcom_err"
1318 if test "x$ac_krb5_version" = "xMIT"
1320 AC_DEFINE(HAVE_MIT_KERBEROS, 1, [Define to use MIT kerberos])
1323 AC_PATH_PROG(KRB5_CONFIG, krb5-config)
1324 if test -x "$KRB5_CONFIG"
1326 KRB5_FLAGS=`"$KRB5_CONFIG" --cflags`
1327 KRB5_LIBS=`"$KRB5_CONFIG" --libs`
1328 CFLAGS="$CFLAGS $KRB5_FLAGS"
1329 CPPFLAGS="$CPPFLAGS $KRB5_FLAGS"
1331 # If -lcrypto is in KRB5_FLAGS, we require it to build
1332 # with Heimdal/MIT. We don't want to built with it by
1333 # default, due to annoying license incompatibilities
1334 # between the OpenSSL license and the GPL, so:
1336 # if SSL_LIBS is set to a non-empty string, we
1337 # remove -lcrypto from KRB5_LIBS and replace
1340 # if SSL_LIBS is not set to a non-empty string
1341 # we fail with an appropriate error message.
1343 case "$KRB5_LIBS" in
1345 if test ! -z "$SSL_LIBS"
1347 KRB5_LIBS=`echo $KRB5_LIBS | sed 's/-lcrypto//'`
1348 KRB5_LIBS="$KRB5_LIBS $SSL_LIBS"
1350 AC_MSG_ERROR([Kerberos library requires -lcrypto but --with-ssl not specified])
1354 ac_krb5_version=`"$KRB5_CONFIG" --version | head -n 1 | sed -e 's/^.*heimdal.*$/HEIMDAL/' -e 's/^Kerberos .*$/MIT/'`
1359 # Make sure we have "krb5.h". If we don't, it means we probably
1360 # don't have kerberos, so don't use it.
1362 AC_CHECK_HEADER(krb5.h,,
1364 if test "x$krb5_dir" != "x"
1367 # The user used "--with-krb5=" to specify a directory
1368 # containing kerberos, but we didn't find the header file
1369 # there; that either means they didn't specify the
1370 # right directory or are confused about whether kerberos
1371 # is, in fact, installed. Report the error and give up.
1373 AC_MSG_ERROR([kerberos header not found in directory specified in --with-krb5])
1375 if test "x$want_krb5" = "xyes"
1378 # The user tried to force us to use the library, but we
1379 # couldn't find the header file; report an error.
1381 AC_MSG_ERROR(Header file krb5.h not found.)
1384 # We couldn't find the header file; don't use the
1385 # library, as it's probably not present.
1388 AC_MSG_RESULT(No Heimdal or MIT header found - disabling dissection for some kerberos data in packet decoding)
1393 if test "x$want_krb5" != "xno"
1396 # Well, we at least have the krb5 header file.
1397 # Check whether this is Heimdal or MIT.
1399 AC_MSG_CHECKING(whether the Kerberos library is Heimdal or MIT)
1400 if test "x$ac_krb5_version" = "xHEIMDAL" -o "x$ac_krb5_version" = "xMIT"
1404 # Check whether we have krb5_kt_resolve - and whether
1405 # we need to link with -lresolv when linking with
1406 # the Kerberos library.
1408 AC_MSG_RESULT($ac_krb5_version)
1409 wireshark_save_LIBS="$LIBS"
1410 found_krb5_kt_resolve=no
1411 for extras in "" "-lresolv"
1413 LIBS="$KRB5_LIBS $extras"
1414 if test -z "$extras"
1416 AC_MSG_CHECKING([whether $ac_krb5_version includes krb5_kt_resolve])
1418 AC_MSG_CHECKING([whether $ac_krb5_version includes krb5_kt_resolve (linking with $extras)])
1428 # We found "krb5_kt_resolve()", and required
1429 # the libraries in extras as well.
1433 AC_DEFINE(HAVE_KERBEROS, 1, [Define to use kerberos])
1434 if test "x$ac_krb5_version" = "xHEIMDAL"
1436 AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1, [Define to use heimdal kerberos])
1437 elif test "x$ac_krb5_version" = "xMIT"
1439 AC_DEFINE(HAVE_MIT_KERBEROS, 1, [Define to use MIT kerberos])
1441 found_krb5_kt_resolve=yes
1448 if test "$found_krb5_kt_resolve" = no
1451 # We didn't find "krb5_kt_resolve()" in the
1452 # Kerberos library, even when we tried linking
1453 # with -lresolv; we can't link with kerberos.
1455 if test "x$want_krb5" = "xyes"
1458 # The user tried to force us to use the library,
1459 # but we can't do so; report an error.
1461 AC_MSG_ERROR(Usable $ac_krb5_version not found)
1464 # Restore the versions of CFLAGS and CPPFLAGS
1465 # from before we added the flags for Kerberos.
1467 AC_MSG_RESULT(Usable $ac_krb5_version not found - disabling dissection for some kerberos data in packet decoding)
1468 CFLAGS="$wireshark_save_CFLAGS"
1469 CPPFLAGS="$wireshark_save_CPPFLAGS"
1475 # We can link with Kerberos; see whether krb5.h
1476 # defines KEYTYPE_ARCFOUR_56 (where "defines" means
1477 # "as a #define or as an enum member).
1479 AC_MSG_CHECKING([whether krb5.h defines KEYTYPE_ARCFOUR_56])
1489 printf("%u\n", KEYTYPE_ARCFOUR_56);
1495 AC_DEFINE(HAVE_KEYTYPE_ARCFOUR_56, 1, [Define if krb5.h defines KEYTYPE_ARCFOUR_56])
1501 LIBS="$wireshark_save_LIBS"
1504 # It's not Heimdal or MIT.
1507 if test "x$want_krb5" = "xyes"
1510 # The user tried to force us to use the library,
1511 # but we can't do so; report an error.
1513 AC_MSG_ERROR(Kerberos not found)
1516 # Restore the versions of CFLAGS and CPPFLAGS
1517 # from before we added the flags for Kerberos.
1519 AC_MSG_RESULT(Kerberos not found - disabling dissection for some kerberos data in packet decoding)
1520 CFLAGS="$wireshark_save_CFLAGS"
1521 CPPFLAGS="$wireshark_save_CPPFLAGS"
1528 # The user asked us not to use Kerberos, or they didn't
1529 # say whether they wanted us to use it but we found
1532 # Restore the versions of CFLAGS and CPPFLAGS
1533 # from before we added the flags for Kerberos.
1535 CFLAGS="$wireshark_save_CFLAGS"
1536 CPPFLAGS="$wireshark_save_CPPFLAGS"
1544 dnl Check whether a given format can be used to print 64-bit integers
1546 AC_DEFUN([AC_WIRESHARK_CHECK_64BIT_FORMAT],
1548 AC_MSG_CHECKING([whether %$1x can be used to format 64-bit integers])
1554 #if GTK_MAJOR_VERSION >= 2
1555 #include <glib/gprintf.h>
1563 #if GTK_MAJOR_VERSION >= 2
1564 g_snprintf(strbuf, sizeof strbuf, "%016$1x", t << 32);
1566 snprintf(strbuf, sizeof strbuf, "%016$1x", t << 32);
1568 if (strcmp(strbuf, "0000000100000000") == 0)
1576 AC_DEFINE(G_GINT64_MODIFIER, "$1", [Format modifier for printing 64-bit numbers])
1586 # AC_WIRESHARK_GCC_CFLAGS_CHECK
1588 # $1 : cflags to test
1590 # The macro first determines if the compiler is GCC. Then compile with the
1591 # defined cflags. The defined flags are added to CFLAGS only if the compilation
1594 AC_DEFUN([AC_WIRESHARK_GCC_CFLAGS_CHECK],
1596 AC_MSG_CHECKING(whether we can add $GCC_OPTION to CFLAGS)
1597 if test "x$GCC" != "x"; then
1598 CFLAGS_saved="$CFLAGS"
1599 CFLAGS="$CFLAGS $GCC_OPTION"
1609 CFLAGS="$CFLAGS_saved"