diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-07-16 02:54:41 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2008-07-16 03:02:15 +0300 |
commit | c3c901cf44cf16bb33c4176494361b429099a372 (patch) | |
tree | 1720c9ef6086b5dcb622769957f19cff49792155 /configure.ac | |
parent | 69b57dc651e12a0d9a5a4295b185c62d5c0df63f (diff) |
configure.ac: Fix SHA1 handling
Fix and marginally simplify the SHA1 handling. First, we allow people
to override it. Secondly, we try for libmd. Then, we try for OpenSSL
with pkg-config. In a last, desperate move, we try libcrypto on its
own. This allows the server to, y'know, _link_ when using OpenSSL,
instead of failing because we only have -lcrypto, and not -lssl.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac index 9daa13c2b..18d8ab5ff 100644 --- a/configure.ac +++ b/configure.ac @@ -1101,26 +1101,30 @@ MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow' MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la' CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' -PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) -PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) - # OpenSSL used for SHA1 hashing in render/glyph.c, but we don't need all of # the OpenSSL libraries, just libcrypto # Some systems have matching functionality in the smaller/simpler libmd # Builders who want to force a choice can set SHA1_LIB and SHA1_CFLAGS if test "x$SHA1_LIB" = "x" ; then - AC_CHECK_LIB([md], [SHA1Init], [SHA1_LIB="-lmd" - AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1], - [Define to use libmd SHA1 functions instead of OpenSSL libcrypto])]) + AC_CHECK_LIB([md], [SHA1Init], [SHA1_LIB="-lmd" + AC_DEFINE([HAVE_SHA1_IN_LIBMD], [1], + [Use libmd SHA1 functions instead of OpenSSL libcrypto])]) fi + if test "x$SHA1_LIB" = "x" ; then - AC_CHECK_LIB([crypto], [SHA1_Init], [], - [PKG_CHECK_MODULES([OPENSSL], [openssl], - [OPENSSL_LIB_FLAGS=`$PKG_CONFIG --libs-only-L --libs-only-other openssl`])]) - SHA1_LIB="$OPENSSL_LIB_FLAGS -lcrypto" - SHA1_CFLAGS="$OPENSSL_CFLAGS" + PKG_CHECK_EXISTS([OPENSSL], [openssl], [HAVE_OPENSSL_PKC=yes], + [HAVE_OPENSSL_PKC=no]) + if test "x$HAVE_OPENSSL_PKC" = xyes; then + REQUIRED_LIBS="$REQUIRED_LIBS openssl" + else + AC_CHECK_LIB([crypto], [SHA1_Init], [SHA1_LIB="-lcrypto"], + [AC_MSG_ERROR([OpenSSL must be installed in order to build the X server.])]) + fi fi +PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS]) +PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS]) + # Autotools has some unfortunate issues with library handling. In order to # get a server to rebuild when a dependency in the tree is changed, it must # be listed in SERVERNAME_DEPENDENCIES. However, no system libraries may be |