diff options
author | Matthieu Patou <mat@matws.net> | 2012-11-22 16:14:42 -0800 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2012-11-29 08:53:09 +0100 |
commit | 40c6cfeb6ff39e73d824f17cb2ddc26eedb2b022 (patch) | |
tree | 5e99cb234fb43a3b4fb29631a6b2f5720dd1567c | |
parent | ecc9f5bdb8c56853a37ff6e980fed815fc5ee0a9 (diff) | |
download | samba-40c6cfeb6ff39e73d824f17cb2ddc26eedb2b022.tar.gz |
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 <mat@matws.net>
-rw-r--r-- | source3/configure.in | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/source3/configure.in b/source3/configure.in index 2018a6eb41c..a29818362c7 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) |