Initial libgcrypt to remove warning in zms and zmu

git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@3188 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
stan 2010-11-11 12:11:06 +00:00
parent 461374dc2a
commit ca4358bfd6
5 changed files with 84 additions and 0 deletions

View File

@ -47,6 +47,9 @@
/* Define to 1 if you have the <ffmpeg/swscale.h> header file. */
#undef HAVE_FFMPEG_SWSCALE_H
/* Define to 1 if you have the <gcrypt.h> header file. */
#undef HAVE_GCRYPT_H
/* Define to 1 if you have the `gethostbyname' function. */
#undef HAVE_GETHOSTBYNAME
@ -98,6 +101,9 @@
/* Define to 1 if you have the `dl' library (-ldl). */
#undef HAVE_LIBDL
/* Define to 1 if you have the `gcrypt' library (-lgcrypt). */
#undef HAVE_LIBGCRYPT
/* Define to 1 if you have the `gnutls-openssl' library (-lgnutls-openssl). */
#undef HAVE_LIBGNUTLS_OPENSSL

63
configure vendored
View File

@ -6614,6 +6614,69 @@ $as_echo "$as_me: WARNING: libcrypto.a is required for authenticated streaming -
fi
else
for ac_header in gcrypt.h
do :
ac_fn_cxx_check_header_mongrel "$LINENO" "gcrypt.h" "ac_cv_header_gcrypt_h" "$ac_includes_default"
if test "x$ac_cv_header_gcrypt_h" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GCRYPT_H 1
_ACEOF
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: zm requires libgcrypt headers to be installed for gnutls" >&5
$as_echo "$as_me: WARNING: zm requires libgcrypt headers to be installed for gnutls" >&2;}
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_check_version in -lgcrypt" >&5
$as_echo_n "checking for gcry_check_version in -lgcrypt... " >&6; }
if test "${ac_cv_lib_gcrypt_gcry_check_version+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgcrypt $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char gcry_check_version ();
int
main ()
{
return gcry_check_version ();
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
ac_cv_lib_gcrypt_gcry_check_version=yes
else
ac_cv_lib_gcrypt_gcry_check_version=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_check_version" >&5
$as_echo "$ac_cv_lib_gcrypt_gcry_check_version" >&6; }
if test "x$ac_cv_lib_gcrypt_gcry_check_version" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGCRYPT 1
_ACEOF
LIBS="-lgcrypt $LIBS"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead" >&5
$as_echo "$as_me: WARNING: libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead" >&2;}
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lgnutls-openssl" >&5
$as_echo_n "checking for MD5 in -lgnutls-openssl... " >&6; }
if test "${ac_cv_lib_gnutls_openssl_MD5+set}" = set; then :

View File

@ -243,6 +243,8 @@ AC_CHECK_LIB(dl,dlsym,,AC_MSG_ERROR(zm requires libdl.a))
if test "$ZM_SSL_LIB" == "openssl"; then
AC_CHECK_LIB(crypto,MD5,,AC_MSG_WARN([libcrypto.a is required for authenticated streaming - use ZM_SSL_LIB option to select gnutls instead]))
else
AC_CHECK_HEADERS(gcrypt.h,,AC_MSG_WARN(zm requires libgcrypt headers to be installed for gnutls),)
AC_CHECK_LIB(gcrypt,gcry_check_version,,AC_MSG_WARN([libgcrypt.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
AC_CHECK_LIB(gnutls-openssl,MD5,,AC_MSG_WARN([gnutls-openssl.a is required for authenticated streaming - use ZM_SSL_LIB option to select openssl instead]))
fi
AC_CHECK_LIB(pcre,pcre_compile,,AC_MSG_WARN(libpcre.a may be required for remote/network camera support))

View File

@ -148,6 +148,16 @@ User *zmLoadUser( const char *username, const char *password )
User *zmLoadAuthUser( const char *auth, bool use_remote_addr )
{
#if HAVE_DECL_MD5
#ifdef HAVE_GCRYPT_H
// Special initialisation for libgcrypt
if ( !gcry_check_version( GCRYPT_VERSION ) )
{
Fatal( "Unable to initialise libgcrypt" );
}
gcry_control( GCRYCTL_DISABLE_SECMEM, 0 );
gcry_control( GCRYCTL_INITIALIZATION_FINISHED, 0 );
#endif // HAVE_GCRYPT_H
const char *remote_addr = "";
if ( use_remote_addr )
{

View File

@ -25,6 +25,9 @@
#if HAVE_LIBGNUTLS_OPENSSL
#include <gnutls/openssl.h>
#if HAVE_GCRYPT_H
#include <gcrypt.h>
#endif // HAVE_GCRYPT_H
#elif HAVE_LIBCRYPTO
#include <openssl/md5.h>
#endif // HAVE_LIBGNUTLS_OPENSSL || HAVE_LIBCRYPTO