summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-09-23 09:22:07 -0700
committerKeith Packard <keithp@keithp.com>2008-09-23 09:22:07 -0700
commita39377cbcbd3091095efbeab25bec18ae520147e (patch)
tree2c2e8fa9adaa87e014db79c86b89784082a9fbf7 /configure.ac
parent10a9bac0257b381367cedff395b40425d584bf59 (diff)
Revert "Render: Use built-in SHA1 library"
This reverts commit d3bd31fddff7894f89ba80a3cdddff49aff08db8. X.org should not be providing a custom SHA1 implementation.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac25
1 files changed, 23 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 278d33b61..60cdc144a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1072,6 +1072,27 @@ 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'
+# 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],
+ [Use libmd SHA1 functions instead of OpenSSL libcrypto])])
+fi
+
+if test "x$SHA1_LIB" = "x" ; then
+ 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])
@@ -1090,9 +1111,9 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
# XSERVER_SYS_LIBS is the set of out-of-tree libraries which all servers
# require.
#
-XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS}"
+XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS} ${SHA1_CFLAGS}"
XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB"
-XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
+XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${SHA1_LIB}"
AC_SUBST([XSERVER_LIBS])
AC_SUBST([XSERVER_SYS_LIBS])