about fix in configure.in for fixing md5 detection

Matthieu Patou mat at matws.net
Wed Nov 21 13:13:57 MST 2012


Hello metze,

I tried your patch 
https://gitweb.samba.org/?p=metze/samba/wip.git;a=commitdiff;h=3e6bd5e72e702ebe127008fb1037909f1c678fa4 
on my system today and it works.

I was looking at it closely today and I think that


-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])
+if x"$samba_cv_md5lib" = x"none" ; then
+       AC_CHECK_LIB(c, MD5Update, [samba_cv_md5lib=""])
  fi

Should be just

-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])
+AC_CHECK_LIB(c, MD5Update, [samba_cv_md5lib=""])

As samba_cv_md5lib is assured to be none as it's define as it two line 
before.

I would also do this change as if samba_cv_md5lib is != "" then it means 
that you have libmd5 (otherwise it just means that you have something 
doing it in the libc).

+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

-       AC_DEFINE(HAVE_LIBMD5, 1,
-                 [Whether libmd5 conformant to rfc1321 is available.])


I also did a front port to master so that my changes to make build on 
osX are not lost.

Matthieu.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-MD5-detection-in-the-autoconf-build.patch
Type: text/x-diff
Size: 2226 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121121/5e8b5ecd/attachment.patch>


More information about the samba-technical mailing list