From a326dc36c37e93343980d0a4843951a702106849 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Thu, 19 Oct 2006 16:53:05 +0000 Subject: Bug(s) fixed: 211426 Bug Description: autotools: support dirsec packages, mozldap6, svrcore Reviewed by: nkinder (Thanks!) Fix Description: Look for the dirsec-nspr and dirsec-nss if nspr and nss are not found in pkg-config. Look for mozldap6 then mozldap in pkg-config. Look for svrcore-devel in pkg-config, then look for it in the system directories. Nathan pointed out that we do not support mozldap v5.x anymore, so we should just look for mozldap6 with pkg-config. I also added an explicit check of the vendor version in the header file to make sure we are using 600 or greater. Platforms tested: RHEL4 Flag Day: no Doc impact: no --- m4/mozldap.m4 | 23 ++++++++++++++++++++--- m4/nspr.m4 | 4 ++++ m4/nss.m4 | 4 ++++ m4/svrcore.m4 | 28 +++++++++++++++++++++++++++- 4 files changed, 55 insertions(+), 4 deletions(-) (limited to 'm4') diff --git a/m4/mozldap.m4 b/m4/mozldap.m4 index 22bfb9d6..c9361987 100644 --- a/m4/mozldap.m4 +++ b/m4/mozldap.m4 @@ -74,9 +74,10 @@ if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then AC_MSG_CHECKING(for mozldap with pkg-config) AC_PATH_PROG(PKG_CONFIG, pkg-config) if test -n "$PKG_CONFIG"; then - if $PKG_CONFIG --exists mozldap; then - nspr_inc=`$PKG_CONFIG --cflags-only-I mozldap` - nspr_lib=`$PKG_CONFIG --libs-only-L mozldap` + if $PKG_CONFIG --exists mozldap6; then + ldapsdk_inc=`$PKG_CONFIG --cflags-only-I mozldap6` + ldapsdk_lib=`$PKG_CONFIG --libs-only-L mozldap6` + AC_MSG_RESULT([using system mozldap6]) else AC_MSG_ERROR([LDAPSDK not found, specify with --with-ldapsdk[-inc|-lib].]) fi @@ -85,3 +86,19 @@ fi if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then AC_MSG_ERROR([LDAPSDK not found, specify with --with-ldapsdk[-inc|-lib].]) fi +dnl make sure the ldap sdk version is 6 or greater - we do not support +dnl the old 5.x or prior versions - the ldap server code expects the new +dnl ber types and other code used with version 6 +save_cppflags="$CPPFLAGS" +CPPFLAGS="$ldapsdk_inc $nss_inc $nspr_inc" +AC_CHECK_HEADER([ldap.h], [isversion6=1], [isversion6=], +[#include +#if LDAP_VENDOR_VERSION < 600 +#error The LDAP C SDK version is not supported +#endif +]) +CPPFLAGS="$save_cppflags" + +if test -z "$isversion6" ; then + AC_MSG_ERROR([The LDAPSDK version in $ldapsdk_inc/ldap-standard.h is not supported]) +fi diff --git a/m4/nspr.m4 b/m4/nspr.m4 index d9d4d83a..81230f66 100644 --- a/m4/nspr.m4 +++ b/m4/nspr.m4 @@ -78,6 +78,10 @@ if test -z "$nspr_inc" -o -z "$nspr_lib"; then nspr_inc=`$PKG_CONFIG --cflags-only-I nspr` nspr_lib=`$PKG_CONFIG --libs-only-L nspr` AC_MSG_RESULT([using system NSPR]) + elif $PKG_CONFIG --exists dirsec-nspr; then + nspr_inc=`$PKG_CONFIG --cflags-only-I dirsec-nspr` + nspr_lib=`$PKG_CONFIG --libs-only-L dirsec-nspr` + AC_MSG_RESULT([using system dirsec NSPR]) else AC_MSG_ERROR([NSPR not found, specify with --with-nspr.]) fi diff --git a/m4/nss.m4 b/m4/nss.m4 index 82712772..a1bf803d 100644 --- a/m4/nss.m4 +++ b/m4/nss.m4 @@ -78,6 +78,10 @@ if test -z "$nss_inc" -o -z "$nss_lib"; then nss_inc=`$PKG_CONFIG --cflags-only-I nss` nss_lib=`$PKG_CONFIG --libs-only-L nss` AC_MSG_RESULT([using system NSS]) + elif $PKG_CONFIG --exists dirsec-nss; then + nss_inc=`$PKG_CONFIG --cflags-only-I dirsec-nss` + nss_lib=`$PKG_CONFIG --libs-only-L dirsec-nss` + AC_MSG_RESULT([using system dirsec NSS]) else AC_MSG_ERROR([NSS not found, specify with --with-nss.]) fi diff --git a/m4/svrcore.m4 b/m4/svrcore.m4 index 420c5838..3ae9662b 100644 --- a/m4/svrcore.m4 +++ b/m4/svrcore.m4 @@ -63,6 +63,32 @@ AC_ARG_WITH(svrcore-lib, ], AC_MSG_RESULT(no)) +dnl svrcore not given - look for pkg-config if test -z "$svrcore_inc" -o -z "$svrcore_lib"; then - AC_MSG_ERROR([svrcore not found, specify with --with-svrcore.]) + AC_MSG_CHECKING(for svrcore with pkg-config) + AC_PATH_PROG(PKG_CONFIG, pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists svrcore-devel; then + svrcore_inc=`$PKG_CONFIG --cflags-only-I svrcore-devel` + svrcore_lib=`$PKG_CONFIG --libs-only-L svrcore-devel` + AC_MSG_RESULT([using system svrcore]) + fi + fi +fi + +if test -z "$svrcore_inc" -o -z "$svrcore_lib"; then +dnl just see if svrcore is already a system library + AC_CHECK_LIB([svrcore], [SVRCORE_GetRegisteredPinObj], [havesvrcore=1], + [], [$nss_inc $nspr_inc $nss_lib -lnss3 -lsoftokn3 $nspr_lib -lplds4 -lplc4 -lnspr4]) + if test -n "$havesvrcore" ; then +dnl just see if svrcore is already a system header file + save_cppflags="$CPPFLAGS" + CPPFLAGS="$nss_inc $nspr_inc" + AC_CHECK_HEADER([svrcore.h], [havesvrcore=1], [havesvrcore=]) + CPPFLAGS="$save_cppflags" + fi +dnl for svrcore to be present, both the library and the header must exist + if test -z "$havesvrcore" ; then + AC_MSG_ERROR([svrcore not found, specify with --with-svrcore.]) + fi fi -- cgit