[PATCH v2] Add libgcrypt as an option for sha1

Rémi Cardona remi at gentoo.org
Sun Oct 4 05:36:34 PDT 2009


Le dimanche 04 octobre 2009 à 13:51 +0200, Julien Cristau a écrit :
> +# SHA1 hashing in render/glyph.c
> +AC_ARG_WITH([sha1],
> +            [AS_HELP_STRING([--with-sha1=[libmd|libgcrypt|libcrypto]],
> +                            [choose SHA1 implementation])])
> +
> +AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
> +if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then
> +	with_sha1=libmd
> +fi

How about this instead (put the default implemenation in AC_ARG_WITH) :

# SHA1 hashing in render/glyph.c
AC_ARG_WITH([sha1],
            [AS_HELP_STRING([--with-sha1=[libmd|libgcrypt|libcrypto]],
                            [choose SHA1 implementation
(default=libmd)])],
            [], [with_sha1=libmd])

AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes])
> +if test "x$with_sha1" = xlibmd && test "x$HAVE_LIBMD" != xyes; then
> +	AC_MSG_ERROR([libmd requested but not found])
> +fi
> +if test "x$with_sha1" = xlibmd; then
> +	AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1],
> +	          [Use libmd SHA1 functions])
> +	SHA1_LIB=-lmd
> +fi
[...]

But even without my suggestion,

Reviewed-by: Rémi Cardona <remi at gentoo.org>

Cheers



More information about the xorg-devel mailing list