about fix in configure.in for fixing md5 detection

Matthieu Patou mat at samba.org
Wed Nov 21 13:25:28 MST 2012


On 11/21/2012 12:13 PM, Matthieu Patou wrote:
> 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.])
>
>
After a closer look it works for me but it might not work on some *bsd:
you have

-if test x"$ac_cv_header_md5_h" = x"yes" -a \
-        x"$samba_cv_md5lib" = x"none" ; then
+if 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 x"$samba_cv_md5lib" = x"none" ; then
+	AC_CHECK_LIB(md5, MD5Update, [samba_cv_md5lib=md5])
  fi


but it should be  (note the addition of test before x"$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


I updated my front port patch.

Matthieu.

-- 
Matthieu Patou
Samba Team
http://samba.org

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


More information about the samba-technical mailing list