[PATCH v2] configure: sha1: check libsha1 using pkg-config instead

Tiago Vignatti tiago.vignatti at nokia.com
Mon May 3 03:37:25 PDT 2010


Previously the code was using AC_CHECK_LIB, guaranteeing whether the library
is correct by tracking sha1_begin function. This paranoic checking is not
necessary given there's only one libsha1 in the market, which surely contains
such function.

Moreover, this patch now improves a bit the sha1 implementation checking
behavior using pkg-config to find the right flags that needs to link against.

Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
- fix keith's bug by using Yaakov suggestion

 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6110d8c..8ae6e2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1382,7 +1382,7 @@ if test "x$with_sha1" = xlibmd; then
 	          [Use libmd SHA1 functions])
 	SHA1_LIBS=-lmd
 fi
-AC_CHECK_LIB([sha1], [sha1_begin], [HAVE_LIBSHA1=yes])
+PKG_CHECK_MODULES([LIBSHA1], [sha1], [HAVE_LIBSHA1=yes], [HAVE_LIBSHA1=no])
 if test "x$with_sha1" = x && test "x$HAVE_LIBSHA1" = xyes; then
    with_sha1=libsha1
 fi
-- 
1.6.0.4



More information about the xorg-devel mailing list