From 430ab3fe3c50b6f1ce4526e82db4a4396493cd5c Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Thu, 22 Nov 2012 16:14:42 -0800 Subject: [PATCH] Fix MD5 detection in the autoconf build This is synthesis of patches made for bugs * 9037 * 9086 * 9094 * 9418 It checks if there is a library for md5 related functions (libmd or libmd5) and if so it checks for the presence of md5.h headers. Signed-off-by: Matthieu Patou --- source3/configure.in | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/source3/configure.in b/source3/configure.in index 014d844..a5cbb62 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -752,35 +752,31 @@ AC_CHECK_HEADERS(netgroup.h) AC_CHECK_HEADERS(linux/falloc.h) dnl check for OS implementation of md5 conformant to rfc1321 -AC_CHECK_HEADERS(md5.h) - samba_cv_md5lib=none -if test x"$ac_cv_header_md5_h" = x"yes"; then - AC_DEFINE(HAVE_MD5_H, 1, - [Whether md5.h is available.]) - AC_CHECK_LIB(md5, MD5Update, [samba_cv_md5lib=md5]) -fi +AC_CHECK_LIB(c, MD5Update, [samba_cv_md5lib=""]) -if test x"$ac_cv_header_md5_h" = x"yes" -a \ - x"$samba_cv_md5lib" = x"none" ; then +if test x"$samba_cv_md5lib" = x"none" ; then AC_CHECK_LIB(md, MD5Update, [samba_cv_md5lib=md]) fi -if test x"$ac_cv_header_md5_h" = x"yes" -a \ - x"$samba_cv_md5lib" = x"none" ; then - AC_CHECK_LIB(c, MD5Update, [samba_cv_md5lib=""]) +if test x"$samba_cv_md5lib" = x"none" ; then + AC_CHECK_LIB(md5, MD5Update, [samba_cv_md5lib=md5]) fi if test x"$samba_cv_md5lib" != x"none" ; then + AC_CHECK_HEADERS(md5.h) +fi + +CRYPTO_MD5_OBJ="../lib/crypto/md5.o" +if test x"$ac_cv_header_md5_h" = x"yes" -a \ + x"$samba_cv_md5lib" != x"none" ; then if test x"$samba_cv_md5lib" != x ; then LIBS="${LIBS} -l${samba_cv_md5lib}" + AC_DEFINE(HAVE_LIBMD5, 1, + [Whether libmd5 conformant to rfc1321 is available.]) fi CRYPTO_MD5_OBJ= - AC_DEFINE(HAVE_LIBMD5, 1, - [Whether libmd5 conformant to rfc1321 is available.]) -else - CRYPTO_MD5_OBJ="../lib/crypto/md5.o" fi AC_SUBST(CRYPTO_MD5_OBJ) -- 1.7.9.5