1 dnl Macros that test for specific features.
2 dnl This file is part of the Autoconf packaging for Ethereal.
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_ETHEREAL_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_ETHEREAL_ADD_DASH_L],
74 # AC_ETHEREAL_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_ETHEREAL_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_ETHEREAL_STRUCT_SA_LEN],
86 [AC_CACHE_CHECK([for sa_len in struct sockaddr], ac_cv_ethereal_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_ethereal_struct_sa_len=yes, ac_cv_ethereal_struct_sa_len=no)])
90 if test $ac_cv_ethereal_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_ETHEREAL_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_ETHEREAL_IPV6_STACK
142 # By Jun-ichiro "itojun" Hagino, <itojun@iijlab.net>
144 AC_DEFUN([AC_ETHEREAL_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_ETHEREAL_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_ETHEREAL_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_ETHEREAL_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_ETHEREAL_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_ETHEREAL_PCAP_CHECK
300 AC_DEFUN([AC_ETHEREAL_PCAP_CHECK],
302 if test -z "$pcap_dir"
305 # XXX need to set a var AC_CHECK_HEADER(pcap.h,,)
308 # The user didn't specify a directory in which libpcap resides;
309 # we assume that the current library search path will work,
310 # but we may have to look for the header in a "pcap"
311 # subdirectory of "/usr/include" or "/usr/local/include",
312 # as some systems apparently put "pcap.h" in a "pcap"
313 # subdirectory, and we also check "$prefix/include" - and
314 # "$prefix/include/pcap", in case $prefix is set to
315 # "/usr/include" or "/usr/local/include".
317 # XXX - should we just add "$prefix/include" to the include
318 # search path and "$prefix/lib" to the library search path?
320 AC_MSG_CHECKING(for extraneous pcap header directories)
322 pcap_dir_list="/usr/include/pcap $prefix/include/pcap $prefix/include"
323 if test "x$ac_cv_enable_usr_local" = "xyes" ; then
324 pcap_dir_list="$pcap_dir_list /usr/local/include/pcap"
326 for pcap_dir in $pcap_dir_list
328 if test -d $pcap_dir ; then
329 if test x$pcap_dir != x/usr/include -a x$pcap_dir != x/usr/local/include ; then
330 CFLAGS="$CFLAGS -I$pcap_dir"
331 CPPFLAGS="$CPPFLAGS -I$pcap_dir"
333 found_pcap_dir=" $found_pcap_dir -I$pcap_dir"
338 if test "$found_pcap_dir" != "" ; then
339 AC_MSG_RESULT(found --$found_pcap_dir added to CFLAGS)
341 AC_MSG_RESULT(not found)
345 # The user specified a directory in which libpcap resides,
346 # so add the "include" subdirectory of that directory to
347 # the include file search path and the "lib" subdirectory
348 # of that directory to the library search path.
350 # XXX - if there's also a libpcap in a directory that's
351 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
352 # make us find the version in the specified directory,
353 # as the compiler and/or linker will search that other
354 # directory before it searches the specified directory.
356 CFLAGS="$CFLAGS -I$pcap_dir/include"
357 CPPFLAGS="$CPPFLAGS -I$pcap_dir/include"
358 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, $pcap_dir/lib)
362 AC_CHECK_HEADER(pcap.h,,
363 AC_MSG_ERROR([[Header file pcap.h not found; if you installed libpcap
364 from source, did you also do \"make install-incl\", and if you installed a
365 binary package of libpcap, is there also a developer's package of libpcap,
366 and did you also install that package?]]))
369 # Check to see if we find "pcap_open_live" in "-lpcap".
370 # Also check for various additional libraries that libpcap might
373 AC_CHECK_LIB(pcap, pcap_open_live,
376 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
378 ac_ethereal_extras_found=no
380 for extras in "-lcfg -lodm" "-lpfring"
382 AC_MSG_CHECKING([for pcap_open_live in -lpcap with $extras])
383 LIBS="-lpcap $extras"
385 # XXX - can't we use AC_CHECK_LIB here?
392 pcap_open_live(NULL, 0, 0, 0, NULL);
395 ac_ethereal_extras_found=yes
397 PCAP_LIBS="-lpcap $extras"
398 AC_DEFINE(HAVE_LIBPCAP, 1, [Define to use libpcap library])
403 if test x$ac_ethereal_extras_found = xyes
408 if test x$ac_ethereal_extras_found = xno
410 AC_MSG_ERROR([Can't link with library libpcap.])
413 ], $SOCKET_LIBS $NSL_LIBS)
417 # Check whether various variables and functions are defined by
421 AC_MSG_CHECKING(whether pcap_version is defined by libpcap)
422 LIBS="$PCAP_LIBS $SOCKET_LIBS $NSL_LIBS $LIBS"
426 extern char *pcap_version;
429 printf ("%s\n", pcap_version);
431 ac_cv_pcap_version_defined=yes,
432 ac_cv_pcap_version_defined=no,
433 [echo $ac_n "cross compiling; assumed OK... $ac_c"])
434 if test "$ac_cv_pcap_version_defined" = yes ; then
436 AC_DEFINE(HAVE_PCAP_VERSION, 1, [Define if libpcap version is known])
440 AC_CHECK_FUNCS(pcap_open_dead pcap_freecode)
442 # Later versions of Mac OS X 10.3[.x] ship a pcap.h that
443 # doesn't define pcap_if_t but ship an 0.8[.x] libpcap,
444 # so the library has "pcap_findalldevs()", but pcap.h
445 # doesn't define "pcap_if_t" so you can't actually *use*
446 # "pcap_findalldevs()".
448 # That even appears to be true of systems shipped with
449 # 10.3.4, so it doesn't appear only to be a case of
450 # Software Update not updating header files.
452 # (You can work around this by installing the 0.8 header
455 AC_CACHE_CHECK([whether pcap_findalldevs is present and usable],
456 [ac_cv_func_pcap_findalldevs],
465 pcap_if_t *devpointer;
468 pcap_findalldevs(&devpointer, errbuf);
473 ac_cv_func_pcap_findalldevs=yes
476 ac_cv_func_pcap_findalldevs=no
480 # Don't check for other new routines that showed up after
481 # "pcap_findalldevs()" if we don't have a usable
482 # "pcap_findalldevs()", so we don't end up using them if the
483 # "pcap.h" is crufty and old and doesn't declare them.
485 if test $ac_cv_func_pcap_findalldevs = "yes" ; then
486 AC_DEFINE(HAVE_PCAP_FINDALLDEVS, 1,
487 [Define to 1 if you have the `pcap_findalldevs' function and a pcap.h that declares pcap_if_t.])
488 AC_CHECK_FUNCS(pcap_datalink_val_to_name pcap_datalink_name_to_val)
489 AC_CHECK_FUNCS(pcap_list_datalinks pcap_set_datalink pcap_lib_version)
490 AC_CHECK_FUNCS(pcap_get_selectable_fd)
496 # AC_ETHEREAL_ZLIB_CHECK
498 AC_DEFUN([AC_ETHEREAL_ZLIB_CHECK],
500 if test "x$zlib_dir" != "x"
503 # The user specified a directory in which zlib resides,
504 # so add the "include" subdirectory of that directory to
505 # the include file search path and the "lib" subdirectory
506 # of that directory to the library search path.
508 # XXX - if there's also a zlib in a directory that's
509 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
510 # make us find the version in the specified directory,
511 # as the compiler and/or linker will search that other
512 # directory before it searches the specified directory.
514 ethereal_save_CFLAGS="$CFLAGS"
515 CFLAGS="$CFLAGS -I$zlib_dir/include"
516 ethereal_save_CPPFLAGS="$CPPFLAGS"
517 CPPFLAGS="$CPPFLAGS -I$zlib_dir/include"
518 ethereal_save_LIBS="$LIBS"
519 AC_ETHEREAL_ADD_DASH_L(LIBS, $zlib_dir/lib)
523 # Make sure we have "zlib.h". If we don't, it means we probably
524 # don't have zlib, so don't use it.
526 AC_CHECK_HEADER(zlib.h,,
528 if test "x$zlib_dir" != "x"
531 # The user used "--with-zlib=" to specify a directory
532 # containing zlib, but we didn't find the header file
533 # there; that either means they didn't specify the
534 # right directory or are confused about whether zlib
535 # is, in fact, installed. Report the error and give up.
537 AC_MSG_ERROR([zlib header not found in directory specified in --with-zlib])
539 if test "x$want_zlib" = "xyes"
542 # The user tried to force us to use the library, but we
543 # couldn't find the header file; report an error.
545 AC_MSG_ERROR(Header file zlib.h not found.)
548 # We couldn't find the header file; don't use the
549 # library, as it's probably not present.
556 if test "x$want_zlib" != "xno"
559 # Well, we at least have the zlib header file.
561 # Check for "gzgets()" in zlib, because we need it, but
562 # some older versions of zlib don't have it. It appears
563 # from the zlib ChangeLog that any released version of zlib
564 # with "gzgets()" should have the other routines we
565 # depend on, such as "gzseek()", "gztell()", and "zError()".
567 # Another reason why we require "gzgets()" is that
568 # some versions of zlib that didn't have it, such
569 # as 1.0.8, had a bug in "gzseek()" that meant that it
570 # doesn't work correctly on uncompressed files; this
571 # means we cannot use version 1.0.8. (Unfortunately,
572 # that's the version that comes with recent X11 source,
573 # and many people who install XFree86 on their Slackware
574 # boxes don't realize that they should configure it to
575 # use the native zlib rather than building and installing
576 # the crappy old version that comes with XFree86.)
578 # I.e., we can't just avoid using "gzgets()", as
579 # versions of zlib without "gzgets()" are likely to have
580 # a broken "gzseek()".
582 AC_CHECK_LIB(z, gzgets,
584 if test "x$zlib_dir" != "x"
587 # Put the "-I" and "-L" flags for zlib at
588 # the beginning of CFLAGS, CPPFLAGS, and
592 AC_ETHEREAL_ADD_DASH_L(LIBS, $zlib_dir/lib)
593 LIBS="$LIBS -lz $ethereal_save_LIBS"
597 AC_DEFINE(HAVE_LIBZ, 1, [Define to use libz library])
599 if test "x$zlib_dir" != "x"
602 # Restore the versions of CFLAGS, CPPFLAGS,
603 # and LIBS before we added the "-with-zlib="
604 # directory, as we didn't actually find
605 # zlib there, or didn't find a zlib that
606 # contains gzgets there.
608 CFLAGS="$ethereal_save_CFLAGS"
609 CPPFLAGS="$ethereal_save_CPPFLAGS"
610 LIBS="$ethereal_save_LIBS"
616 if test "x$want_zlib" != "xno"
619 # Well, we at least have the zlib header file and a zlib
622 # Now check for "gzgets()" in zlib when linking with the
623 # linker flags for GTK+ applications; people often grab
624 # XFree86 source and build and install it on their systems,
625 # and they appear sometimes to misconfigure XFree86 so that,
626 # even on systems with zlib, it assumes there is no zlib,
627 # so the XFree86 build process builds and installs its
628 # own zlib in the X11 library directory.
630 # The XFree86 zlib is an older version that lacks
631 # "gzgets()", and that's the zlib with which Ethereal
632 # gets linked, so the build of Ethereal fails.
634 ac_save_CFLAGS="$CFLAGS"
636 CFLAGS="$CFLAGS $GTK_CFLAGS"
637 LIBS="$GTK_LIBS -lz $LIBS"
638 AC_MSG_CHECKING([for gzgets missing when linking with X11])
639 AC_TRY_LINK_FUNC(gzgets, AC_MSG_RESULT(no),
642 AC_MSG_ERROR(old zlib found when linking with X11 - get rid of old zlib.)
644 CFLAGS="$ac_save_CFLAGS"
650 # AC_ETHEREAL_LIBPCRE_CHECK
652 AC_DEFUN([AC_ETHEREAL_LIBPCRE_CHECK],
654 if test "x$pcre_dir" != "x"
657 # The user specified a directory in which libpcre resides,
658 # so add the "include" subdirectory of that directory to
659 # the include file search path and the "lib" subdirectory
660 # of that directory to the library search path.
662 # XXX - if there's also a libpcre in a directory that's
663 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
664 # make us find the version in the specified directory,
665 # as the compiler and/or linker will search that other
666 # directory before it searches the specified directory.
668 ethereal_save_CFLAGS="$CFLAGS"
669 CFLAGS="$CFLAGS -I$pcre_dir/include"
670 ethereal_save_CPPFLAGS="$CPPFLAGS"
671 CPPFLAGS="$CPPFLAGS -I$pcre_dir/include"
672 ethereal_save_LIBS="$LIBS"
674 ethereal_save_LDFLAGS="$LDFLAGS"
675 LDFLAGS="$LDFLAGS -L$pcre_dir/lib"
679 # Make sure we have "pcre.h". If we don't, it means we probably
680 # don't have libpcre, so don't use it.
682 AC_CHECK_HEADER(pcre.h,,
684 if test "x$pcre_dir" != "x"
687 # The user used "--with-pcre=" to specify a directory
688 # containing libpcre, but we didn't find the header file
689 # there; that either means they didn't specify the
690 # right directory or are confused about whether libpcre
691 # is, in fact, installed. Report the error and give up.
693 AC_MSG_ERROR([libpcre header not found in directory specified in --with-pcre])
695 if test "x$want_pcre" = "xyes"
698 # The user tried to force us to use the library, but we
699 # couldn't find the header file; report an error.
701 AC_MSG_ERROR(Header file pcre.h not found.)
704 # We couldn't find the header file; don't use the
705 # library, as it's probably not present.
712 if test "x$want_pcre" != "xno"
715 # Well, we at least have the pcre header file.
717 # We're only using standard functions from libpcre,
718 # so we don't need to perform extra checks.
720 AC_CHECK_LIB(pcre, pcre_compile,
722 if test "x$pcre_dir" != "x"
725 # Put the "-I" and "-L" flags for pcre at
726 # the beginning of CFLAGS, CPPFLAGS,
729 PCRE_LIBS="-L$pcre_dir/lib -lpcre $ethereal_save_LIBS"
733 AC_DEFINE(HAVE_LIBPCRE, 1, [Define to use libpcre library])
735 if test "x$pcre_dir" != "x"
738 # Restore the versions of CFLAGS, CPPFLAGS,
739 # LDFLAGS, and LIBS before we added the
740 # "--with-pcre=" directory, as we didn't
741 # actually find pcre there.
743 CFLAGS="$ethereal_save_CFLAGS"
744 CPPFLAGS="$ethereal_save_CPPFLAGS"
745 LDFLAGS="$ethereal_save_LDFLAGS"
746 LIBS="$ethereal_save_LIBS"
756 # AC_ETHEREAL_LIBLUA_CHECK
758 AC_DEFUN([AC_ETHEREAL_LIBLUA_CHECK],[
760 if test "x$lua_dir" != "x"
763 # The user specified a directory in which liblua resides,
764 # so add the "include" subdirectory of that directory to
765 # the include file search path and the "lib" subdirectory
766 # of that directory to the library search path.
768 # XXX - if there's also a liblua in a directory that's
769 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
770 # make us find the version in the specified directory,
771 # as the compiler and/or linker will search that other
772 # directory before it searches the specified directory.
774 ethereal_save_CFLAGS="$CFLAGS"
775 CFLAGS="$CFLAGS -I$lua_dir/include"
776 ethereal_save_CPPFLAGS="$CPPFLAGS"
777 CPPFLAGS="$CPPFLAGS -I$lua_dir/include"
778 ethereal_save_LIBS="$LIBS"
779 LIBS="$LIBS -L$lua_dir/lib -llua"
780 ethereal_save_LDFLAGS="$LDFLAGS"
781 LDFLAGS="$LDFLAGS -L$lua_dir/lib"
784 # The user specified no directory in which liblua resides,
785 # so just add "-llua -lliblua" to the used libs.
787 ethereal_save_CFLAGS="$CFLAGS"
788 ethereal_save_CPPFLAGS="$CPPFLAGS"
789 ethereal_save_LDFLAGS="$LDFLAGS"
790 ethereal_save_LIBS="$LIBS"
795 # Make sure we have "lua.h", "lualib.h" and "lauxlib.h". If we don't, it means we probably
796 # don't have liblua, so don't use it.
798 AC_CHECK_HEADERS(lua.h lualib.h lauxlib.h,,
800 if test "x$lua_dir" != "x"
803 # The user used "--with-lua=" to specify a directory
804 # containing liblua, but we didn't find the header file
805 # there; that either means they didn't specify the
806 # right directory or are confused about whether liblua
807 # is, in fact, installed. Report the error and give up.
809 AC_MSG_ERROR([liblua header not found in directory specified in --with-lua])
811 if test "x$want_lua" = "xyes"
814 # The user tried to force us to use the library, but we
815 # couldn't find the header file; report an error.
817 AC_MSG_ERROR(Header file lua.h not found.)
820 # We couldn't find the header file; don't use the
821 # library, as it's probably not present.
828 if test "x$want_lua" != "xno"
831 # Well, we at least have the lua header file.
833 # let's check if the libs are there
836 # At least on Suse 9.3 systems, liblualib needs linking
838 LIBS="$LIBS $LUA_LIBS -lm"
840 AC_CHECK_LIB(lua, lua_call,
842 if test "x$lua_dir" != "x"
845 # Put the "-I" and "-L" flags for lua at
846 # the beginning of CFLAGS, CPPFLAGS,
849 LUA_LIBS="-L$lua_dir/lib -llua"
850 LUA_INCLUDES="-I$lua_dir/include"
857 # we got lua, now look for lualib
859 AC_CHECK_LIB(lualib, luaL_openlib,
864 LUA_LIBS="$LUA_LIBS -llualib"
867 # no lualib, in 5.1 there's only liblua
871 LIBS="$ethereal_save_LIBS $LUA_LIBS"
873 AC_CHECK_LIB(lua, luaL_register,
878 AC_DEFINE(HAVE_LUA_5_1, 1, [Define to use Lua 5.1])
883 if test "x$lua_dir" != "x"
886 # Restore the versions of CFLAGS, CPPFLAGS,
887 # LDFLAGS, and LIBS before we added the
888 # "--with-lua=" directory, as we didn't
889 # actually find lua there.
891 CFLAGS="$ethereal_save_CFLAGS"
892 CPPFLAGS="$ethereal_save_CPPFLAGS"
893 LDFLAGS="$ethereal_save_LDFLAGS"
894 LIBS="$ethereal_save_LIBS"
897 # User requested --with-lua but it isn't available
898 if test "x$want_lua" = "xyes"
900 AC_MSG_ERROR(Linking with liblualib failed.)
907 # Restore the versions of CFLAGS, CPPFLAGS,
908 # LDFLAGS, and LIBS before we added the
909 # "--with-lua=" directory, as we didn't
910 # actually find lua there.
912 CFLAGS="$ethereal_save_CFLAGS"
913 CPPFLAGS="$ethereal_save_CPPFLAGS"
914 LDFLAGS="$ethereal_save_LDFLAGS"
915 LIBS="$ethereal_save_LIBS"
917 # User requested --with-lua but it isn't available
918 if test "x$want_lua" = "xyes"
920 AC_MSG_ERROR(Linking with liblua failed.)
925 CFLAGS="$ethereal_save_CFLAGS"
926 CPPFLAGS="$ethereal_save_CPPFLAGS"
927 LDFLAGS="$ethereal_save_LDFLAGS"
928 LIBS="$ethereal_save_LIBS"
930 AC_SUBST(LUA_INCLUDES)
936 # AC_ETHEREAL_NETSNMP_CHECK
938 AC_DEFUN([AC_ETHEREAL_NETSNMP_CHECK],
940 dnl get the net-snmp-config binary
941 if test "x$netsnmpconfig" = "x" ; then
943 # The user didn't specify where net-snmp-config is
944 # located; search for it.
946 AC_PATH_PROG(NETSNMPCONFIG, net-snmp-config)
948 NETSNMPCONFIG=$netsnmpconfig
949 if test ! -x $NETSNMPCONFIG -o ! -f $NETSNMPCONFIG ; then
950 NETSNMPCONFIG=$netsnmpconfig/bin/net-snmp-config
951 if test ! -x $NETSNMPCONFIG -o ! -f $NETSNMPCONFIG ; then
952 AC_MSG_ERROR(Invalid net-snmp-config: $netsnmpconfig)
958 # XXX - check whether $NETSNMPCONFIG is executable?
959 # if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCONFIG" ; then
960 # We already did that if it was set; presumably AC_PATH_PROG
961 # will fail if it doesn't find an executable version.
963 if test "x$NETSNMPCONFIG" != "x" ; then
964 dnl other choices for flags to use here: could also use
965 dnl --prefix or --exec-prefix if you don't want the full list.
968 # Save the current settings of CFLAGS and CPPFLAGS, and add
969 # the output of "$NETSNMPCONFIG --cflags" to it, so that when
970 # searching for the Net-SNMP headers, we look in whatever
971 # directory that output specifies.
973 ethereal_save_CFLAGS="$CFLAGS"
974 ethereal_save_CPPFLAGS="$CPPFLAGS"
975 CFLAGS="$CFLAGS `$NETSNMPCONFIG --cflags`"
976 CPPFLAGS="$CPPFLAGS `$NETSNMPCONFIG --cflags`"
978 AC_CHECK_HEADERS(net-snmp/net-snmp-config.h net-snmp/library/default_store.h)
979 if test "x$ac_cv_header_net_snmp_net_snmp_config_h" = "xyes" -a "x$ac_cv_header_net_snmp_library_default_store_h" = "xyes" ; then
980 SNMP_LIBS=`$NETSNMPCONFIG --libs`
981 if echo "$SNMP_LIBS" | grep crypto >/dev/null && test "x$SSL_LIBS" = "x"; then
982 if test "x$want_netsnmp" = "xyes" ; then
983 AC_MSG_ERROR(Net-SNMP requires openssl but ssl not enabled)
985 AC_MSG_RESULT(Net-SNMP requires openssl but ssl not enabled - disabling Net-SNMP)
987 CFLAGS="$ethereal_save_CFLAGS"
988 CPPFLAGS="$ethereal_save_CPPFLAGS"
991 AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for Net-SNMP])
995 if test "x$want_netsnmp" = "xyes" ; then
996 AC_MSG_ERROR(Net-SNMP not found)
999 # Restore the versions of CFLAGS and
1000 # CPPFLAGS before we added the output
1001 # of '$NETSNMPCONFIG --cflags", as we
1002 # didn't actually find Net-SNMP there.
1004 CFLAGS="$ethereal_save_CFLAGS"
1005 CPPFLAGS="$ethereal_save_CPPFLAGS"
1012 # AC_ETHEREAL_UCDSNMP_CHECK
1014 AC_DEFUN([AC_ETHEREAL_UCDSNMP_CHECK],
1016 if test "x$ucdsnmp_dir" != "x"
1019 # The user specified a directory in which UCD SNMP resides,
1020 # so add the "include" subdirectory of that directory to
1021 # the include file search path and the "lib" subdirectory
1022 # of that directory to the library search path.
1024 # XXX - if there's also a libpcap in a directory that's
1025 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
1026 # make us find the version in the specified directory,
1027 # as the compiler and/or linker will search that other
1028 # directory before it searches the specified directory.
1030 CFLAGS="$CFLAGS -I$ucdsnmp_dir/include"
1031 CPPFLAGS="$CPPFLAGS -I$ucdsnmp_dir/include"
1032 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, $ucdsnmp_dir/lib)
1036 # Check for one of the UCD SNMP header files we include,
1037 # to see whether we have UCD SNMP installed.
1039 AC_CHECK_HEADER(ucd-snmp/ucd-snmp-config.h,
1042 # UCD SNMP or Net-SNMP might require various helper
1043 # libraries on various platforms, such as "-ldes425"
1044 # in "/usr/kerberos/lib" on some versions of Red
1045 # Hat Linux, or "-lkstat" on Solaris.
1047 # It might also require "-lcrypto" on some platforms;
1048 # if the user didn't specify --with-ssl, we check
1049 # whether it would have made a difference and, if so,
1050 # we tell the user that they needed to request it.
1051 # (There are annoying licensing issues with it and
1052 # GPL'ed code, so we don't include it by default.)
1054 # XXX - autoconf really needs a way to test for
1055 # a given routine in a given library *and* to test
1056 # whether additional "-L"/"-R"/whatever flags are
1057 # needed *before* the "-l" flag for the library
1058 # and to test whether additional libraries are
1059 # needed after the library *and* to cache all that
1062 ethereal_save_LIBS="$LIBS"
1063 found_sprint_realloc_objid=no
1064 for extras in "" "-L/usr/kerberos/lib -ldes425" "-lkstat"
1066 LIBS="-lsnmp $extras $SOCKET_LIBS $NSL_LIBS $SSL_LIBS"
1067 if test -z "$extras"
1069 AC_MSG_CHECKING([whether UCD SNMP includes sprint_realloc_objid])
1071 AC_MSG_CHECKING([whether UCD SNMP includes sprint_realloc_objid (linking with $extras)])
1077 sprint_realloc_objid();
1081 # We found "sprint_realloc_objid()",
1082 # and required the libraries in
1086 SNMP_LIBS="-lsnmp $extras"; break;
1087 found_sprint_realloc_objid=yes
1092 # The link failed. If they didn't ask
1093 # for SSL, try linking with -lcrypto
1094 # as well, and if *that* succeeds,
1095 # tell them they'll need to specify
1099 if test "x$want_ssl" = "xno"
1101 LIBS="$LIBS -lcrypto"
1106 sprint_realloc_objid();
1110 # It worked with -lcrypto; tell
1111 # them they'll need to specify
1114 AC_MSG_ERROR([UCD SNMP requires -lcrypto but --with-ssl not specified])
1119 LIBS="$ethereal_save_LIBS"
1122 # If we didn't find "sprint_realloc_objid()", fail.
1123 # Either the user needs a newer version of UCD SNMP
1124 # with "sprint_realloc_objid()", or they may need to
1125 # specify "--with-ssl".
1127 if test "$found_snmp_sprint_realloc_objid" = no; then
1128 AC_MSG_ERROR([UCD SNMP header files found, but sprint_realloc_objid not found in SNMP library.])
1132 # We found it, so we have UCD SNMP.
1134 AC_DEFINE(HAVE_UCD_SNMP, 1, [Define to enable support for UCD-SNMP])
1138 # No, we don't have it.
1139 # If the user explicitly asked for UCD SNMP, fail,
1140 # otherwise just don't use the UCD SNMP library.
1142 if test "x$want_ucdsnmp" = "xyes" ; then
1143 AC_MSG_ERROR(Header file ucd-snmp/snmp.h not found.)
1149 # AC_ETHEREAL_RPM_CHECK
1150 # Looks for the rpm program, and checks to see if we can redefine "_topdir".
1152 AC_DEFUN([AC_ETHEREAL_RPM_CHECK],
1154 AC_CHECK_PROG(ac_cv_ethereal_have_rpm, rpm, "yes", "no")
1155 if test "x$ac_cv_ethereal_have_rpm" = "xyes"; then
1156 rpm --define '_topdir /tmp' > /dev/null 2>&1
1157 AC_MSG_CHECKING(to see if we can redefine _topdir)
1158 if test $? -eq 0 ; then
1162 AC_MSG_RESULT(no. You'll have to build packages manually.)
1169 # AC_ETHEREAL_GNU_SED_CHECK
1170 # Checks if GNU sed is the first sed in PATH.
1172 AC_DEFUN([AC_ETHEREAL_GNU_SED_CHECK],
1174 AC_MSG_CHECKING(for GNU sed as first sed in PATH)
1175 if ( sh -c "sed --version" </dev/null 2> /dev/null | grep "GNU sed" 2>&1 > /dev/null ) ; then
1185 # AC_ETHEREAL_ADNS_CHECK
1187 AC_DEFUN([AC_ETHEREAL_ADNS_CHECK],
1189 want_adns=defaultyes
1191 if test "x$want_adns" = "xdefaultyes"; then
1194 if test -d "$withval"; then
1195 AC_ETHEREAL_ADD_DASH_L(LDFLAGS, ${withval}/lib)
1199 if test "x$want_adns" = "xyes"; then
1200 AC_CHECK_LIB(adns, adns_init,
1203 AC_DEFINE(HAVE_GNU_ADNS, 1, [Define to use GNU ADNS library])
1205 ],, $SOCKET_LIBS $NSL_LIBS
1208 AC_MSG_RESULT(not required)
1214 # AC_ETHEREAL_KRB5_CHECK
1216 AC_DEFUN([AC_ETHEREAL_KRB5_CHECK],
1218 ethereal_save_CFLAGS="$CFLAGS"
1219 ethereal_save_CPPFLAGS="$CPPFLAGS"
1220 if test "x$krb5_dir" != "x"
1223 # The user specified a directory in which kerberos resides,
1224 # so add the "include" subdirectory of that directory to
1225 # the include file search path and the "lib" subdirectory
1226 # of that directory to the library search path.
1228 # XXX - if there's also a kerberos in a directory that's
1229 # already in CFLAGS, CPPFLAGS, or LDFLAGS, this won't
1230 # make us find the version in the specified directory,
1231 # as the compiler and/or linker will search that other
1232 # directory before it searches the specified directory.
1234 CFLAGS="$CFLAGS -I$krb5_dir/include"
1235 CPPFLAGS="$CPPFLAGS -I$krb5_dir/include"
1236 ac_heimdal_version=`grep heimdal $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/'`
1237 ac_mit_version=`grep 'Massachusetts Institute of Technology' $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*Massachusetts Institute of Technology.*$/MIT/'`
1238 ac_krb5_version="$ac_heimdal_version$ac_mit_version"
1239 if test "x$ac_krb5_version" = "xHEIMDAL"
1240 KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lasn1 $SSL_LIBS -lroken -lcrypt"
1242 KRB5_LIBS="-L$krb5_dir/lib -lkrb5 -lk5crypto -lcom_err"
1244 if test "x$ac_krb5_version" = "xMIT"
1246 AC_DEFINE(HAVE_MIT_KERBEROS, 1, [Define to use MIT kerberos])
1249 AC_PATH_PROG(KRB5_CONFIG, krb5-config)
1250 if test -x "$KRB5_CONFIG"
1252 KRB5_FLAGS=`"$KRB5_CONFIG" --cflags`
1253 KRB5_LIBS=`"$KRB5_CONFIG" --libs`
1254 CFLAGS="$CFLAGS $KRB5_FLAGS"
1255 CPPFLAGS="$CPPFLAGS $KRB5_FLAGS"
1257 # If -lcrypto is in KRB5_FLAGS, we require it to build
1258 # with Heimdal/MIT. We don't want to built with it by
1259 # default, due to annoying license incompatibilities
1260 # between the OpenSSL license and the GPL, so:
1262 # if SSL_LIBS is set to a non-empty string, we
1263 # remove -lcrypto from KRB5_LIBS and replace
1266 # if SSL_LIBS is not set to a non-empty string
1267 # we fail with an appropriate error message.
1269 case "$KRB5_LIBS" in
1271 if test ! -z "$SSL_LIBS"
1273 KRB5_LIBS=`echo $KRB5_LIBS | sed 's/-lcrypto//'`
1274 KRB5_LIBS="$KRB5_LIBS $SSL_LIBS"
1276 AC_MSG_ERROR([Kerberos library requires -lcrypto but --with-ssl not specified])
1280 ac_krb5_version=`"$KRB5_CONFIG" --version | head -n 1 | sed -e 's/^.*heimdal.*$/HEIMDAL/' -e 's/^Kerberos .*$/MIT/'`
1285 # Make sure we have "krb5.h". If we don't, it means we probably
1286 # don't have kerberos, so don't use it.
1288 AC_CHECK_HEADER(krb5.h,,
1290 if test "x$krb5_dir" != "x"
1293 # The user used "--with-krb5=" to specify a directory
1294 # containing kerberos, but we didn't find the header file
1295 # there; that either means they didn't specify the
1296 # right directory or are confused about whether kerberos
1297 # is, in fact, installed. Report the error and give up.
1299 AC_MSG_ERROR([kerberos header not found in directory specified in --with-krb5])
1301 if test "x$want_krb5" = "xyes"
1304 # The user tried to force us to use the library, but we
1305 # couldn't find the header file; report an error.
1307 AC_MSG_ERROR(Header file krb5.h not found.)
1310 # We couldn't find the header file; don't use the
1311 # library, as it's probably not present.
1314 AC_MSG_RESULT(No Heimdal or MIT header found - disabling dissection for some kerberos data in packet decoding)
1319 if test "x$want_krb5" != "xno"
1322 # Well, we at least have the krb5 header file.
1323 # Check whether this is Heimdal or MIT.
1325 AC_MSG_CHECKING(whether the Kerberos library is Heimdal or MIT)
1326 if test "x$ac_krb5_version" = "xHEIMDAL" -o "x$ac_krb5_version" = "xMIT"
1330 # Check whether we have krb5_kt_resolve - and whether
1331 # we need to link with -lresolv when linking with
1332 # the Kerberos library.
1334 AC_MSG_RESULT($ac_krb5_version)
1335 ethereal_save_LIBS="$LIBS"
1336 found_krb5_kt_resolve=no
1337 for extras in "" "-lresolv"
1339 LIBS="$KRB5_LIBS $extras"
1340 if test -z "$extras"
1342 AC_MSG_CHECKING([whether $ac_krb5_version includes krb5_kt_resolve])
1344 AC_MSG_CHECKING([whether $ac_krb5_version includes krb5_kt_resolve (linking with $extras)])
1354 # We found "krb5_kt_resolve()", and required
1355 # the libraries in extras as well.
1359 AC_DEFINE(HAVE_KERBEROS, 1, [Define to use kerberos])
1360 if test "x$ac_krb5_version" = "xHEIMDAL"
1362 AC_DEFINE(HAVE_HEIMDAL_KERBEROS, 1, [Define to use heimdal kerberos])
1363 elif test "x$ac_krb5_version" = "xMIT"
1365 AC_DEFINE(HAVE_MIT_KERBEROS, 1, [Define to use MIT kerberos])
1367 found_krb5_kt_resolve=yes
1374 if test "$found_krb5_kt_resolve" = no
1377 # We didn't find "krb5_kt_resolve()" in the
1378 # Kerberos library, even when we tried linking
1379 # with -lresolv; we can't link with kerberos.
1381 if test "x$want_krb5" = "xyes"
1384 # The user tried to force us to use the library,
1385 # but we can't do so; report an error.
1387 AC_MSG_ERROR(Usable $ac_krb5_version not found)
1390 # Restore the versions of CFLAGS and CPPFLAGS
1391 # from before we added the flags for Kerberos.
1393 AC_MSG_RESULT(Usable $ac_krb5_version not found - disabling dissection for some kerberos data in packet decoding)
1394 CFLAGS="$ethereal_save_CFLAGS"
1395 CPPFLAGS="$ethereal_save_CPPFLAGS"
1401 # We can link with Kerberos; see whether krb5.h
1402 # defines KEYTYPE_ARCFOUR_56 (where "defines" means
1403 # "as a #define or as an enum member).
1405 AC_MSG_CHECKING([whether krb5.h defines KEYTYPE_ARCFOUR_56])
1415 printf("%u\n", KEYTYPE_ARCFOUR_56);
1421 AC_DEFINE(HAVE_KEYTYPE_ARCFOUR_56, 1, [Define if krb5.h defines KEYTYPE_ARCFOUR_56])
1427 LIBS="$ethereal_save_LIBS"
1430 # It's not Heimdal or MIT.
1433 if test "x$want_krb5" = "xyes"
1436 # The user tried to force us to use the library,
1437 # but we can't do so; report an error.
1439 AC_MSG_ERROR(Kerberos not found)
1442 # Restore the versions of CFLAGS and CPPFLAGS
1443 # from before we added the flags for Kerberos.
1445 AC_MSG_RESULT(Kerberos not found - disabling dissection for some kerberos data in packet decoding)
1446 CFLAGS="$ethereal_save_CFLAGS"
1447 CPPFLAGS="$ethereal_save_CPPFLAGS"
1454 # The user asked us not to use Kerberos, or they didn't
1455 # say whether they wanted us to use it but we found
1458 # Restore the versions of CFLAGS and CPPFLAGS
1459 # from before we added the flags for Kerberos.
1461 CFLAGS="$ethereal_save_CFLAGS"
1462 CPPFLAGS="$ethereal_save_CPPFLAGS"
1469 dnl Autoconf macros for libgnutls
1471 # Modified for LIBGNUTLS -- nmav
1472 # Configure paths for LIBGCRYPT
1473 # Shamelessly stolen from the one of XDELTA by Owen Taylor
1474 # Werner Koch 99-12-09
1476 dnl AM_PATH_LIBGNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
1477 dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
1479 AC_DEFUN([AM_PATH_LIBGNUTLS],
1481 dnl Get the cflags and libraries from the libgnutls-config script
1483 AC_ARG_WITH(libgnutls-prefix,
1484 [ --with-libgnutls-prefix=PFX Prefix where libgnutls is installed (optional)],
1485 libgnutls_config_prefix="$withval", libgnutls_config_prefix="")
1487 if test x$libgnutls_config_prefix != x ; then
1488 if test x${LIBGNUTLS_CONFIG+set} != xset ; then
1489 LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
1493 AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
1494 min_libgnutls_version=ifelse([$1], ,0.1.0,$1)
1495 AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
1497 if test "$LIBGNUTLS_CONFIG" = "no" ; then
1500 LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
1501 LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
1502 libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
1504 ac_save_CFLAGS="$CFLAGS"
1505 ac_save_LIBS="$LIBS"
1506 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
1507 LIBS="$LIBS $LIBGNUTLS_LIBS"
1509 dnl Now check if the installed libgnutls is sufficiently new. Also sanity
1510 dnl checks the results of libgnutls-config to some extent
1512 rm -f conf.libgnutlstest
1517 #include <gnutls/gnutls.h>
1522 system ("touch conf.libgnutlstest");
1524 if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
1526 printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
1527 "$libgnutls_config_version", gnutls_check_version(NULL) );
1528 printf("*** was found! If libgnutls-config was correct, then it is best\n");
1529 printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
1530 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1531 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1532 printf("*** required on your system.\n");
1533 printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
1534 printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
1535 printf("*** before re-running configure\n");
1537 else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
1539 printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
1540 printf("*** library (version %s)\n", gnutls_check_version(NULL) );
1544 if ( gnutls_check_version( "$min_libgnutls_version" ) )
1550 printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
1551 gnutls_check_version(NULL) );
1552 printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
1553 "$min_libgnutls_version" );
1554 printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
1556 printf("*** If you have already installed a sufficiently new version, this error\n");
1557 printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
1558 printf("*** being found. The easiest way to fix this is to remove the old version\n");
1559 printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
1560 printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
1561 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1562 printf("*** so that the correct libraries are found at run-time))\n");
1567 ],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1568 CFLAGS="$ac_save_CFLAGS"
1569 LIBS="$ac_save_LIBS"
1572 if test "x$no_libgnutls" = x ; then
1574 ifelse([$2], , :, [$2])
1576 if test -f conf.libgnutlstest ; then
1581 if test "$LIBGNUTLS_CONFIG" = "no" ; then
1582 echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
1583 echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
1584 echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
1585 echo "*** full path to libgnutls-config."
1587 if test -f conf.libgnutlstest ; then
1590 echo "*** Could not run libgnutls test program, checking why..."
1591 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
1592 LIBS="$LIBS $LIBGNUTLS_LIBS"
1597 #include <gnutls/gnutls.h>
1598 ], [ return !!gnutls_check_version(NULL); ],
1599 [ echo "*** The test program compiled, but did not run. This usually means"
1600 echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
1601 echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
1602 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1603 echo "*** to the installed location Also, make sure you have run ldconfig if that"
1604 echo "*** is required on your system"
1606 echo "*** If you have an old version installed, it is best to remove it, although"
1607 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1609 [ echo "*** The test program failed to compile or link. See the file config.log for the"
1610 echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
1611 echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
1612 echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ])
1613 CFLAGS="$ac_save_CFLAGS"
1614 LIBS="$ac_save_LIBS"
1619 ifelse([$3], , :, [$3])
1621 rm -f conf.libgnutlstest
1622 AC_SUBST(LIBGNUTLS_CFLAGS)
1623 AC_SUBST(LIBGNUTLS_LIBS)