- Require --with-ssl=... to be explicitly set to work

around licensing problems
- Cause krb5 and snmp to fail, if ssl is required but
  not configured.

svn path=/trunk/; revision=11416
This commit is contained in:
Jörg Mayer 2004-07-18 20:33:54 +00:00
parent 4fdb830569
commit dd99d1eb50
2 changed files with 54 additions and 24 deletions

View File

@ -733,20 +733,35 @@ AC_DEFUN([AC_ETHEREAL_UCDSNMP_CHECK],
# #
for extras in "" "-L/usr/kerberos/lib -ldes425" "-lkstat" for extras in "" "-L/usr/kerberos/lib -ldes425" "-lkstat"
do do
AC_CHECK_LIB(snmp, sprint_realloc_objid, LIBS="$SOCKET_LIBS $NSL_LIBS $SSL_LIBS $extras"
AC_TRY_LINK(
[ [
SNMP_LIBS="-lsnmp $extras"; break
], ],
[ [
# sprint_realloc_objid();
# Throw away the cached "we didn't find it" ],
# answer, so that if we rerun "configure", [
# we still do all these checks and don't SNMP_LIBS="-lsnmp $extras"; break;
# just blithely assume we don't need ],
# the extra libraries. [
# ])
unset ac_cv_lib_snmp_sprint_realloc_objid
], $SOCKET_LIBS $NSL_LIBS $SSL_LIBS $extras) # int sprint_realloc_objid(u_char **buf, size_t *buf_len, size_t *out_len, int allow_realloc, const oid *objid, size_t objidlen);
# AC_TRY_LINK(includes, body, [if-found], [if-not-found])
# AC_CHECK_LIB(snmp, sprint_realloc_objid,
# [
# SNMP_LIBS="-lsnmp $extras"; break
# ],
# [
# #
# # Throw away the cached "we didn't find it"
# # answer, so that if we rerun "configure",
# # we still do all these checks and don't
# # just blithely assume we don't need
# # the extra libraries.
# #
# unset ac_cv_lib_snmp_sprint_realloc_objid
# ], $SOCKET_LIBS $NSL_LIBS $SSL_LIBS $extras)
done done
# #
@ -781,11 +796,11 @@ AC_DEFUN([AC_ETHEREAL_UCDSNMP_CHECK],
# #
AC_DEFUN([AC_ETHEREAL_SSL_CHECK], AC_DEFUN([AC_ETHEREAL_SSL_CHECK],
[ [
want_ssl=defaultyes want_ssl=defaultno
AC_ARG_WITH(ssl, AC_ARG_WITH(ssl,
changequote(<<, >>)dnl changequote(<<, >>)dnl
<< --with-ssl[=DIR] use SSL crypto library (located in directory DIR, if supplied). [default=yes, if present]>>, << --with-ssl[=DIR] use SSL crypto library (located in directory DIR, if supplied). [default=no]>>,
changequote([, ])dnl changequote([, ])dnl
[ [
if test "x$withval" = "xno"; then if test "x$withval" = "xno"; then
@ -807,11 +822,23 @@ changequote([, ])dnl
fi fi
if test "x$want_ssl" = "xyes"; then if test "x$want_ssl" = "xyes"; then
AC_CHECK_LIB(crypto, EVP_md5, LIBS="-lcrypto"
AC_TRY_LINK(
[ [
void EVP_md5();
],
[
EVP_md5();
],
[
AC_MSG_RESULT([yes])
SSL_LIBS=-lcrypto SSL_LIBS=-lcrypto
],, ],
) [
AC_MSG_RESULT([no])
AC_MSG_ERROR([libcrypto failed link test.])
])
else else
AC_MSG_RESULT(not required) AC_MSG_RESULT(not required)
fi fi
@ -920,9 +947,7 @@ AC_DEFUN([AC_ETHEREAL_KRB5_CHECK],
CFLAGS="$CFLAGS -I$krb5_dir/include" CFLAGS="$CFLAGS -I$krb5_dir/include"
ethereal_save_CPPFLAGS="$CPPFLAGS" ethereal_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$krb5_dir/include" CPPFLAGS="$CPPFLAGS -I$krb5_dir/include"
#ethereal_save_LIBS="$LIBS" KRB5_LIBS="-lkrb5 -lasn1 $SSL_LIBS -lroken -lcrypt -lresolv"
#LIBS="$LIBS -lkrb5 -lasn1 -lcrypto -lroken -lcrypt -lresolv"
KRB5_LIBS="-lkrb5 -lasn1 -lcrypto -lroken -lcrypt -lresolv"
ethereal_save_LDFLAGS="$LDFLAGS" ethereal_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$krb5_dir/lib" LDFLAGS="$LDFLAGS -L$krb5_dir/lib"
ac_krb5_version=`grep -i heimdal $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/i'` ac_krb5_version=`grep -i heimdal $krb5_dir/include/krb5.h | head -n 1 | sed 's/^.*heimdal.*$/HEIMDAL/i'`

View File

@ -816,6 +816,11 @@ if test "x$NETSNMPCONFIG" != "xno" -a "x$NETSNMPCONFIG" != "x" -a -x "$NETSNMPCO
AC_CHECK_HEADERS(net-snmp/net-snmp-config.h net-snmp/library/default_store.h) AC_CHECK_HEADERS(net-snmp/net-snmp-config.h net-snmp/library/default_store.h)
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 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
SNMP_LIBS=`$NETSNMPCONFIG --libs` SNMP_LIBS=`$NETSNMPCONFIG --libs`
if test "x$SSL_LIBS" = "x" ; then
if echo "$SNMP_LIBS" | grep crypto ; then
AC_MSG_ERROR(SNMP requires openssl but ssl not enabled)
fi
fi
AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for NET-SNMP]) AC_DEFINE(HAVE_NET_SNMP, 1, [Define to enable support for NET-SNMP])
have_net_snmp="yes" have_net_snmp="yes"
else else