Add support for c-ares to the GNU toolchain.

svn path=/trunk/; revision=25955
This commit is contained in:
Gerald Combs 2008-08-08 00:04:38 +00:00
parent 9569e7a299
commit 9fbab46ad4
4 changed files with 70 additions and 5 deletions

View File

@ -317,6 +317,7 @@ wireshark_LDADD = \
@PCRE_LIBS@ \
@PCAP_LIBS@ \
@GTK_LIBS@ \
@C_ARES_LIBS@ \
@ADNS_LIBS@ \
@KRB5_LIBS@ \
@FRAMEWORKS@ \
@ -346,6 +347,7 @@ tshark_LDADD = \
@PCAP_LIBS@ \
@SOCKET_LIBS@ \
@NSL_LIBS@ \
@C_ARES_LIBS@ \
@ADNS_LIBS@ \
@KRB5_LIBS@ \
@FRAMEWORKS@ \
@ -374,6 +376,7 @@ rawshark_LDADD = \
@PCAP_LIBS@ \
@SOCKET_LIBS@ \
@NSL_LIBS@ \
@C_ARES_LIBS@ \
@ADNS_LIBS@ \
@KRB5_LIBS@ \
@FRAMEWORKS@ \
@ -418,6 +421,7 @@ randpkt_LDADD = \
@PCAP_LIBS@ \
@SOCKET_LIBS@ \
@NSL_LIBS@ \
@C_ARES_LIBS@ \
@ADNS_LIBS@
# Libraries and plugin flags with which to link dftest.
@ -433,6 +437,7 @@ dftest_LDADD = \
@PCAP_LIBS@ \
@SOCKET_LIBS@ \
@NSL_LIBS@ \
@C_ARES_LIBS@ \
@ADNS_LIBS@ \
@KRB5_LIBS@ \
@LIBGCRYPT_LIBS@ \

View File

@ -1192,6 +1192,37 @@ AC_DEFUN([AC_WIRESHARK_GNU_SED_CHECK],
fi
])
#
# AC_WIRESHARK_C_ARES_CHECK
#
AC_DEFUN([AC_WIRESHARK_C_ARES_CHECK],
[
want_c_ares=defaultyes
if test "x$want_c_ares" = "xdefaultyes"; then
want_c_ares=yes
if test "x$ac_cv_enable_usr_local" = "xyes" ; then
withval=/usr/local
if test -d "$withval"; then
AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
fi
fi
fi
if test "x$want_c_ares" = "xyes"; then
AC_CHECK_LIB(cares, ares_init,
[
C_ARES_LIBS=-lcares
AC_DEFINE(HAVE_C_ARES, 1, [Define to use c-ares library])
have_good_c_ares=yes
],, $SOCKET_LIBS $NSL_LIBS
)
else
AC_MSG_RESULT(not required)
fi
])
#
# AC_WIRESHARK_ADNS_CHECK
#

View File

@ -1194,9 +1194,31 @@ else
fi
dnl ADNS Check
ADNS_LIBS=''
AC_MSG_CHECKING(whether to use the GNU ADNS library if available)
dnl c-ares Check
C_ARES_LIBS=''
AC_MSG_CHECKING(whether to use the c-ares library if available)
AC_ARG_WITH(c-ares,
AC_HELP_STRING( [--with-c-ares@<:@=DIR@:>@],
[use c-ares (located in directory DIR, if supplied). Supersedes --with-adns. @<:@default=yes, if present@:>@]),
[
if test "x$withval" = "xno"; then
want_c_ares=no
elif test "x$withval" = "xyes"; then
want_c_ares=yes
elif test -d "$withval"; then
want_c_ares=yes
AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
fi
])
if test "x$want_c_ares" = "xno" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
AC_WIRESHARK_C_ARES_CHECK
fi
AC_SUBST(C_ARES_LIBS)
AC_ARG_WITH(adns,
AC_HELP_STRING( [--with-adns@<:@=DIR@:>@],
@ -1211,7 +1233,7 @@ elif test -d "$withval"; then
AC_WIRESHARK_ADD_DASH_L(LDFLAGS, ${withval}/lib)
fi
])
if test "x$with_adns" = "xno" ; then
if test "x$want_adns" = "xno" -o "x$have_good_c_ares" = "xyes" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
@ -1639,6 +1661,12 @@ else
krb5_message="yes ($ac_krb5_version)"
fi
if test "x$have_good_c_ares" = "xyes" ; then
c_ares_message="yes"
else
c_ares_message="no"
fi
if test "x$have_good_adns" = "xyes" ; then
adns_message="yes"
else
@ -1675,6 +1703,7 @@ echo " Use pcap library : $want_pcap"
echo " Use zlib library : $zlib_message"
echo " Use pcre library : $pcre_message"
echo " Use kerberos library : $krb5_message"
echo " Use c-ares library : $c_ares_message"
echo " Use GNU ADNS library : $adns_message"
echo " Use SMI MIB library : $libsmi_message"
echo " Use GNU crypto library : $gcrypt_message"

View File

@ -128,7 +128,7 @@ libwireshark_la_LIBADD = \
dfilter/libdfilter.la dissectors/libcleandissectors.la \
dissectors/libdissectors.la dissectors/libasndissectors.la \
dissectors/libpidldissectors.la $(wslua_lib) @SOCKET_LIBS@ @NSL_LIBS@ \
@ADNS_LIBS@ @LIBGCRYPT_LIBS@ @LIBGNUTLS_LIBS@ @KRB5_LIBS@ \
@C_ARES_LIBS@ @ADNS_LIBS@ @LIBGCRYPT_LIBS@ @LIBGNUTLS_LIBS@ @KRB5_LIBS@ \
@SSL_LIBS@ @LIBSMI_LDFLAGS@ -lm
libwireshark_la_DEPENDENCIES = \
@INET_ATON_LO@ @INET_PTON_LO@ @INET_NTOP_LO@ libwireshark_generated.la \