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 --- configure | 359 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 355 insertions(+), 4 deletions(-) (limited to 'configure') diff --git a/configure b/configure index 7e082c63..de314824 100755 --- a/configure +++ b/configure @@ -23574,6 +23574,11 @@ fi nspr_lib=`$PKG_CONFIG --libs-only-L nspr` echo "$as_me:$LINENO: result: using system NSPR" >&5 echo "${ECHO_T}using system NSPR" >&6 + 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` + echo "$as_me:$LINENO: result: using system dirsec NSPR" >&5 +echo "${ECHO_T}using system dirsec NSPR" >&6 else { { echo "$as_me:$LINENO: error: NSPR not found, specify with --with-nspr." >&5 echo "$as_me: error: NSPR not found, specify with --with-nspr." >&2;} @@ -23733,6 +23738,11 @@ fi nss_lib=`$PKG_CONFIG --libs-only-L nss` echo "$as_me:$LINENO: result: using system NSS" >&5 echo "${ECHO_T}using system NSS" >&6 + 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` + echo "$as_me:$LINENO: result: using system dirsec NSS" >&5 +echo "${ECHO_T}using system dirsec NSS" >&6 else { { echo "$as_me:$LINENO: error: NSS not found, specify with --with-nss." >&5 echo "$as_me: error: NSS not found, specify with --with-nss." >&2;} @@ -23887,9 +23897,11 @@ echo "${ECHO_T}no" >&6 fi 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` + echo "$as_me:$LINENO: result: using system mozldap6" >&5 +echo "${ECHO_T}using system mozldap6" >&6 else { { echo "$as_me:$LINENO: error: LDAPSDK not found, specify with --with-ldapsdk-inc|-lib." >&5 echo "$as_me: error: LDAPSDK not found, specify with --with-ldapsdk-inc|-lib." >&2;} @@ -23902,6 +23914,74 @@ if test -z "$ldapsdk_inc" -o -z "$ldapsdk_lib"; then echo "$as_me: error: LDAPSDK not found, specify with --with-ldapsdk-inc|-lib." >&2;} { (exit 1); exit 1; }; } fi +save_cppflags="$CPPFLAGS" +CPPFLAGS="$ldapsdk_inc $nss_inc $nspr_inc" +echo "$as_me:$LINENO: checking for ldap.h" >&5 +echo $ECHO_N "checking for ldap.h... $ECHO_C" >&6 +if test "${ac_cv_header_ldap_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#if LDAP_VENDOR_VERSION < 600 +#error The LDAP C SDK version is not supported +#endif + + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_ldap_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_ldap_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_ldap_h" >&5 +echo "${ECHO_T}$ac_cv_header_ldap_h" >&6 +if test $ac_cv_header_ldap_h = yes; then + isversion6=1 +else + isversion6= +fi + + +CPPFLAGS="$save_cppflags" + +if test -z "$isversion6" ; then + { { echo "$as_me:$LINENO: error: The LDAPSDK version in $ldapsdk_inc/ldap-standard.h is not supported" >&5 +echo "$as_me: error: The LDAPSDK version in $ldapsdk_inc/ldap-standard.h is not supported" >&2;} + { (exit 1); exit 1; }; } +fi # BEGIN COPYRIGHT BLOCK # Copyright (C) 2006 Red Hat, Inc. @@ -24204,9 +24284,280 @@ echo "${ECHO_T}no" >&6 fi; if test -z "$svrcore_inc" -o -z "$svrcore_lib"; then - { { echo "$as_me:$LINENO: error: svrcore not found, specify with --with-svrcore." >&5 + echo "$as_me:$LINENO: checking for svrcore with pkg-config" >&5 +echo $ECHO_N "checking for svrcore with pkg-config... $ECHO_C" >&6 + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + 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` + echo "$as_me:$LINENO: result: using system svrcore" >&5 +echo "${ECHO_T}using system svrcore" >&6 + fi + fi +fi + +if test -z "$svrcore_inc" -o -z "$svrcore_lib"; then + echo "$as_me:$LINENO: checking for SVRCORE_GetRegisteredPinObj in -lsvrcore" >&5 +echo $ECHO_N "checking for SVRCORE_GetRegisteredPinObj in -lsvrcore... $ECHO_C" >&6 +if test "${ac_cv_lib_svrcore_SVRCORE_GetRegisteredPinObj+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsvrcore $nss_inc $nspr_inc $nss_lib -lnss3 -lsoftokn3 $nspr_lib -lplds4 -lplc4 -lnspr4 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char SVRCORE_GetRegisteredPinObj (); +int +main () +{ +SVRCORE_GetRegisteredPinObj (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_svrcore_SVRCORE_GetRegisteredPinObj=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_svrcore_SVRCORE_GetRegisteredPinObj=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_svrcore_SVRCORE_GetRegisteredPinObj" >&5 +echo "${ECHO_T}$ac_cv_lib_svrcore_SVRCORE_GetRegisteredPinObj" >&6 +if test $ac_cv_lib_svrcore_SVRCORE_GetRegisteredPinObj = yes; then + havesvrcore=1 +fi + + if test -n "$havesvrcore" ; then + save_cppflags="$CPPFLAGS" + CPPFLAGS="$nss_inc $nspr_inc" + if test "${ac_cv_header_svrcore_h+set}" = set; then + echo "$as_me:$LINENO: checking for svrcore.h" >&5 +echo $ECHO_N "checking for svrcore.h... $ECHO_C" >&6 +if test "${ac_cv_header_svrcore_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_svrcore_h" >&5 +echo "${ECHO_T}$ac_cv_header_svrcore_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking svrcore.h usability" >&5 +echo $ECHO_N "checking svrcore.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking svrcore.h presence" >&5 +echo $ECHO_N "checking svrcore.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: svrcore.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: svrcore.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: svrcore.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: svrcore.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: svrcore.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: svrcore.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: svrcore.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: svrcore.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: svrcore.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: svrcore.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: svrcore.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: svrcore.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: svrcore.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: svrcore.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: svrcore.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: svrcore.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to http://bugzilla.redhat.com/ ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for svrcore.h" >&5 +echo $ECHO_N "checking for svrcore.h... $ECHO_C" >&6 +if test "${ac_cv_header_svrcore_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_svrcore_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_svrcore_h" >&5 +echo "${ECHO_T}$ac_cv_header_svrcore_h" >&6 + +fi +if test $ac_cv_header_svrcore_h = yes; then + havesvrcore=1 +else + havesvrcore= +fi + + + CPPFLAGS="$save_cppflags" + fi + if test -z "$havesvrcore" ; then + { { echo "$as_me:$LINENO: error: svrcore not found, specify with --with-svrcore." >&5 echo "$as_me: error: svrcore not found, specify with --with-svrcore." >&2;} { (exit 1); exit 1; }; } + fi fi # BEGIN COPYRIGHT BLOCK -- cgit