Build: modernize crypto library detection

Use package config instead of checking headers.
Package config is faster because it does not invoke compiler
and guarantees proper linking flags because these are provided
by package maintainer instead of hardcoded into build system.

Reviewed-By: Martin Basti <mbasti@redhat.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Petr Spacek 2016-10-12 11:01:02 +02:00 committed by Martin Basti
parent 7b801682a6
commit 01072fc8f2
3 changed files with 6 additions and 10 deletions

View File

@ -125,12 +125,7 @@ AC_SUBST(LDAP_LIBS)
dnl ---------------------------------------------------------------------------
dnl - Check for OpenSSL Crypto library
dnl ---------------------------------------------------------------------------
dnl This is a very simple check, we should probably check also for MD4_Init and
dnl probably also the version we are using is recent enough
SSL_LIBS=
AC_CHECK_HEADER(openssl/md4.h, [], [AC_MSG_ERROR([openssl/md4.h not found])])
AC_CHECK_LIB(crypto, MD4_Init, [SSL_LIBS="-lcrypto"])
AC_SUBST(SSL_LIBS)
PKG_CHECK_MODULES([CRYPTO], [libcrypto], [], [AC_MSG_ERROR([libcrypto not found])])
dnl ---------------------------------------------------------------------------
dnl - Check for UUID library
@ -381,6 +376,6 @@ echo "
LDAP libs: ${LDAP_LIBS}
KRB5 libs: ${KRB5_LIBS}
KRAD libs: ${KRAD_LIBS}
OpenSSL libs: ${SSL_LIBS}
OpenSSL crypto libs: ${CRYPTO_LIBS}
Maintainer mode: ${USE_MAINTAINER_MODE}
"

View File

@ -23,6 +23,7 @@ AM_CPPFLAGS = \
-DLDAPIDIR=\""$(localstatedir)/run"\" \
-DHAVE_LDAP \
-I $(KRB5_UTIL_DIR) \
$(CRYPTO_CFLAGS) \
$(LDAP_CFLAGS) \
$(KRB5_CFLAGS) \
$(WARN_CFLAGS) \
@ -48,10 +49,10 @@ ipasam_la_LDFLAGS = \
$(NULL)
ipasam_la_LIBADD = \
$(CRYPTO_LIBS) \
$(LDAP_LIBS) \
$(KRB5_LIBS) \
$(TALLOC_LIBS) \
$(SSL_LIBS) \
$(SAMBAUTIL_LIBS) \
$(NDR_LIBS) \
$(SAMBA40EXTRA_LIBS) \

View File

@ -19,16 +19,16 @@ AM_CPPFLAGS = \
-DLIBDIR=\""$(libdir)"\" \
-DLIBEXECDIR=\""$(libexecdir)"\" \
-DDATADIR=\""$(datadir)"\" \
$(CRYPTO_CFLAGS) \
$(LDAP_CFLAGS) \
$(KRB5_CFLAGS) \
$(SSL_CFLAGS) \
$(NSS_CFLAGS) \
$(WARN_CFLAGS) \
$(NULL)
AM_LDFLAGS = \
$(CRYPTO_LIBS) \
$(KRB5_LIBS) \
$(SSL_LIBS) \
$(LDAP_LIBS) \
$(NSPR_LIBS) \
$(NSS_LIBS) \