diff options
author | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-10-04 01:17:41 +0000 |
---|---|---|
committer | mharmsen <mharmsen@c9f7a03b-bd48-0410-a16d-cbbf54688b0b> | 2011-10-04 01:17:41 +0000 |
commit | a4682ceae6774956461edd03b2485bbacea445f4 (patch) | |
tree | 94c475a125441da63101738220ce3972cf37db61 /pki/base/tps/m4 | |
parent | 0c775428675d2cb1be9551f84e6b741ca813f77e (diff) | |
download | pki-a4682ceae6774956461edd03b2485bbacea445f4.tar.gz pki-a4682ceae6774956461edd03b2485bbacea445f4.tar.xz pki-a4682ceae6774956461edd03b2485bbacea445f4.zip |
Bugzilla Bug #688225 - (dogtagIPAv2.1) TRACKER: of the Dogtag fixes for freeIPA 2.1IPA_v2_RHEL_6_2_20111003
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/tags/IPA_v2_RHEL_6_2_20111003@2252 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/tps/m4')
-rw-r--r-- | pki/base/tps/m4/apr.m4 | 345 | ||||
-rw-r--r-- | pki/base/tps/m4/nspr.m4 | 93 | ||||
-rw-r--r-- | pki/base/tps/m4/nss.m4 | 93 | ||||
-rw-r--r-- | pki/base/tps/m4/openldap.m4 | 157 | ||||
-rw-r--r-- | pki/base/tps/m4/sasl.m4 | 112 | ||||
-rw-r--r-- | pki/base/tps/m4/svrcore.m4 | 113 |
6 files changed, 913 insertions, 0 deletions
diff --git a/pki/base/tps/m4/apr.m4 b/pki/base/tps/m4/apr.m4 new file mode 100644 index 000000000..88c177b02 --- /dev/null +++ b/pki/base/tps/m4/apr.m4 @@ -0,0 +1,345 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +AC_CHECKING(for Apr) + +# check for --with-apr +AC_MSG_CHECKING(for --with-apr) +AC_ARG_WITH(apr, [ --with-apr=PATH Apr directory], +[ + if test -e "$withval"/include/apr-0/apr.h -a -d "$withval"/lib -a -d "$withval"/bin + then + AC_MSG_RESULT([using $withval]) + APRDIR=$withval + apr_inc="-DAPRDIR -I$APRDIR/include -I$APRDIR/include/apr-0" + apr_lib_version="apr-0" + case $host in + *-*-linux*) + if test -n "$USE_64" + then + apr_lib="-L$APRDIR/lib64" + apr_libdir="$APRDIR/lib64" + else + apr_lib="-L$APRDIR/lib" + apr_libdir="$APRDIR/lib" + fi + apr_bindir="$APRDIR/bin" + ;; + sparc-sun-solaris*) + if test -n "$USE_64" + then + apr_lib="-L$APRDIR/lib/sparcv9" + apr_libdir="$APRDIR/lib/sparcv9" + apr_bindir="$APRDIR/bin/sparcv9" + else + apr_lib="-L$APRDIR/lib" + apr_libdir="$APRDIR/lib" + apr_bindir="$APRDIR/bin" + fi + ;; + *) + AC_MSG_ERROR([unconfigured platform $host]) + ;; + esac + elif test -e "$withval"/include/apr-1/apr.h -a -d "$withval"/lib -a -d "$withval"/bin + then + AC_MSG_RESULT([using $withval]) + APRDIR=$withval + apr_inc="-DAPRDIR -I$APRDIR/include -I$APRDIR/include/apr-1" + apr_lib_version="apr-1" + case $host in + *-*-linux*) + if test -n "$USE_64" + then + apr_lib="-L$APRDIR/lib64" + apr_libdir="$APRDIR/lib64" + else + apr_lib="-L$APRDIR/lib" + apr_libdir="$APRDIR/lib" + fi + apr_bindir="$APRDIR/bin" + ;; + sparc-sun-solaris*) + if test -n "$USE_64" + then + apr_lib="-L$APRDIR/lib/sparcv9" + apr_libdir="$APRDIR/lib/sparcv9" + apr_bindir="$APRDIR/bin/sparcv9" + else + apr_lib="-L$APRDIR/lib" + apr_libdir="$APRDIR/lib" + apr_bindir="$APRDIR/bin" + fi + ;; + *) + AC_MSG_ERROR([unconfigured platform $host]) + ;; + esac + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-apr-inc +AC_MSG_CHECKING(for --with-apr-inc) +AC_ARG_WITH(apr-inc, [ --with-apr-inc=PATH Apr include file directory], +[ + if test -e "$withval"/apr.h + then + AC_MSG_RESULT([using $withval]) + APRDIR=$withval/.. + apr_inc="-DAPRDIR -I$withval/.. -I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-apr-lib +AC_MSG_CHECKING(for --with-apr-lib) +AC_ARG_WITH(apr-lib, [ --with-apr-lib=PATH Apr library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + apr_lib="-L$withval" + apr_libdir="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi + if test -e "$withval/libapr-0.so" + then + apr_lib_version="apr-0" + elif test -e "$withval/libapr-1.so" + then + apr_lib_version="apr-1" + else + AC_MSG_ERROR([libapr in $withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-apr-bin +AC_MSG_CHECKING(for --with-apr-bin) +AC_ARG_WITH(apr-bin, [ --with-apr-bin=PATH Apr executables directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + apr_bindir="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for Apr in well-known locations +# e. g. - on certain platforms, check for the presence +# of a "Fortitude"-enabled web-server first +AC_MSG_CHECKING(for APR in well-known locations) +case $host in + *-*-linux*) + if test -f /usr/include/apr-0/apr.h + then + apr_inc="-DAPRDIR -I/usr/include -I/usr/include/apr-0" + elif test -f /usr/include/apr-1/apr.h + then + apr_inc="-DAPRDIR -I/usr/include -I/usr/include/apr-1" + else + AC_MSG_ERROR([apr.h not found]) + fi + if test -n "$USE_64" + then + if test -e /usr/lib64/libapr-0.so + then + apr_lib="-L/usr/lib64" + apr_libdir="/usr/lib64" + apr_lib_version="apr-0" + elif test -e /usr/lib64/libapr-1.so + then + apr_lib="-L/usr/lib64" + apr_libdir="/usr/lib64" + apr_lib_version="apr-1" + else + AC_MSG_ERROR([libapr not found]) + fi + else + if test -e /usr/lib/libapr-0.so + then + apr_lib="-L/usr/lib" + apr_libdir="/usr/lib" + apr_lib_version="apr-0" + elif test -e /usr/lib/libapr-1.so + then + apr_lib="-L/usr/lib" + apr_libdir="/usr/lib" + apr_lib_version="apr-1" + else + AC_MSG_ERROR([libapr not found]) + fi + fi + if test -x /usr/bin/apr-config + then + apr_bindir="/usr/bin" + elif test -x /usr/bin/apr-1-config + then + apr_bindir="/usr/bin" + else + AC_MSG_ERROR([apr-config or apr-1-config not found]) + fi + AC_MSG_RESULT([using system Apr in /usr]) + ;; + sparc-sun-solaris*) + if test -d /opt/fortitude + then + if test -f /opt/fortitude/include/apr-0/apr.h + then + apr_inc="-DAPRDIR -I/opt/fortitude/include -I/opt/fortitude/include/apr-0" + else + AC_MSG_ERROR([/opt/fortitude/include/apr-0/apr.h not found]) + fi + if test -n "$USE_64" + then + ############################################################# + ### NOTE: The 64-bit Fortitude "sparcv9" libraries and ### + ### programs are now under "/opt/fortitude/lib" ### + ### and "/opt/fortitude/bin" rather than ### + ### "/opt/fortitude/lib/sparcv9" and ### + ### "/opt/fortitude/bin/sparcv9"!!! ### + ### ### + ### To help guard against any future movement ### + ### of any of these libraries and/or programs, ### + ### this m4 file will first check under the ### + ### "sparcv9" directory, and then the directory ### + ### immediately above the "sparcv9" directory. ### + ############################################################# + if test -e /opt/fortitude/lib/sparcv9/libapr-0.so + then + apr_lib="-L/opt/fortitude/lib/sparcv9" + apr_libdir="/opt/fortitude/lib/sparcv9" + apr_lib_version="apr-0" + else + if test -e /opt/fortitude/lib/libapr-0.so + then + apr_lib="-L/opt/fortitude/lib" + apr_libdir="/opt/fortitude/lib" + apr_lib_version="apr-0" + else + AC_MSG_ERROR([Fortitude-enabled libapr-0.so not found]) + fi + fi + if test -x /opt/fortitude/bin/sparcv9/apr-config + then + apr_bindir="/opt/fortitude/bin/sparcv9" + else + if test -x /opt/fortitude/bin/apr-config + then + apr_bindir="/opt/fortitude/bin" + else + AC_MSG_ERROR([Fortitude-enabled apr-config not found]) + fi + fi + else + if test -e /opt/fortitude/lib/libapr-0.so + then + apr_lib="-L/opt/fortitude/lib" + apr_libdir="/opt/fortitude/lib" + apr_lib_version="apr-0" + else + AC_MSG_ERROR([/opt/fortitude/lib/libapr-0.so not found]) + fi + if test -x /opt/fortitude/bin/apr-config + then + apr_bindir="/opt/fortitude/bin" + else + AC_MSG_ERROR([/opt/fortitude/bin/apr-config not found]) + fi + fi + AC_MSG_RESULT([using Fortitude-enabled Apr in /opt/fortitude]) + else + if test -f /usr/local/include/apr-0/apr.h + then + apr_inc="-DAPRDIR -I/usr/local/include -I/usr/local/include/apr-0" + else + AC_MSG_ERROR([/usr/local/include/apr-0/apr.h not found]) + fi + if test -n "$USE_64" + then + if test -e /usr/local/lib/sparcv9/libapr-0.so + then + apr_lib="-L/usr/local/lib/sparcv9" + apr_libdir="/usr/local/lib/sparcv9" + apr_lib_version="apr-0" + else + AC_MSG_ERROR([/usr/local/lib/sparcv9/libapr-0.so not found]) + fi + if test -x /usr/local/bin/sparcv9/apr-config + then + apr_bindir="/usr/local/bin/sparcv9" + else + AC_MSG_ERROR([/usr/local/bin/sparcv9/apr-config not found]) + fi + else + if test -e /usr/local/lib/libapr-0.so + then + apr_lib="-L/usr/local/lib" + apr_libdir="/usr/local/lib" + apr_lib_version="apr-0" + else + AC_MSG_ERROR([/usr/local/lib/libapr-0.so not found]) + fi + if test -x /usr/local/bin/apr-config + then + apr_bindir="/usr/local/bin" + else + AC_MSG_ERROR([/usr/local/bin/apr-config not found]) + fi + fi + fi + AC_MSG_RESULT([using system Apr in /usr/local]) + ;; + *) + AC_MSG_ERROR([unconfigured platform $host]) + ;; +esac + +# if Apr has not been found, print an error and exit +if test -z "$apr_inc" +then + AC_MSG_ERROR([Apr include file directory not found, specify with --with-apr.]) +fi +if test -z "$apr_lib" -o -z "$apr_libdir" +then + AC_MSG_ERROR([Apr library directory not found, specify with --with-apr.]) +fi +if test -z "$apr_bindir" +then + AC_MSG_ERROR([Apr executables directory not found, specify with --with-apr.]) +fi +if test -z "$apr_lib_version" +then + AC_MSG_ERROR([Apr library version not found, specify with --with-apr.]) +fi + diff --git a/pki/base/tps/m4/nspr.m4 b/pki/base/tps/m4/nspr.m4 new file mode 100644 index 000000000..c6d0694f9 --- /dev/null +++ b/pki/base/tps/m4/nspr.m4 @@ -0,0 +1,93 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +AC_CHECKING(for NSPR) + +# check for --with-nspr +AC_MSG_CHECKING(for --with-nspr) +AC_ARG_WITH(nspr, [ --with-nspr=PATH Netscape Portable Runtime (NSPR) directory], +[ + if test -e "$withval"/include/nspr.h -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + NSPRDIR=$withval + nspr_inc="-I$NSPRDIR/include" + nspr_lib="-L$NSPRDIR/lib" + nspr_libdir="$NSPRDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nspr-inc +AC_MSG_CHECKING(for --with-nspr-inc) +AC_ARG_WITH(nspr-inc, [ --with-nspr-inc=PATH Netscape Portable Runtime (NSPR) include file directory], +[ + if test -e "$withval"/nspr.h + then + AC_MSG_RESULT([using $withval]) + nspr_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nspr-lib +AC_MSG_CHECKING(for --with-nspr-lib) +AC_ARG_WITH(nspr-lib, [ --with-nspr-lib=PATH Netscape Portable Runtime (NSPR) library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + nspr_lib="-L$withval" + nspr_libdir="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if NSPR is not found yet, try pkg-config + +# last resort +if test -z "$nspr_inc" -o -z "$nspr_lib" -o -z "$nspr_libdir"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config) + AC_MSG_CHECKING(for nspr with pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nspr; then + nspr_inc=`$PKG_CONFIG --cflags-only-I nspr` + nspr_lib=`$PKG_CONFIG --libs-only-L nspr` + nspr_libdir=`$PKG_CONFIG --libs-only-L nspr | sed -e s/-L// | sed -e s/\ *$//` + 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` + nspr_libdir=`$PKG_CONFIG --libs-only-L dirsec-nspr | sed -e s/-L// | sed -e s/\ *$//` + AC_MSG_RESULT([using system dirsec NSPR]) + else + AC_MSG_ERROR([NSPR not found, specify with --with-nspr.]) + fi + fi +fi diff --git a/pki/base/tps/m4/nss.m4 b/pki/base/tps/m4/nss.m4 new file mode 100644 index 000000000..46e74cdb1 --- /dev/null +++ b/pki/base/tps/m4/nss.m4 @@ -0,0 +1,93 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +AC_CHECKING(for NSS) + +# check for --with-nss +AC_MSG_CHECKING(for --with-nss) +AC_ARG_WITH(nss, [ --with-nss=PATH Network Security Services (NSS) directory], +[ + if test -e "$withval"/include/nss.h -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + NSSDIR=$withval + nss_inc="-I$NSSDIR/include" + nss_lib="-L$NSSDIR/lib" + nss_libdir="$NSSDIR/lib" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nss-inc +AC_MSG_CHECKING(for --with-nss-inc) +AC_ARG_WITH(nss-inc, [ --with-nss-inc=PATH Network Security Services (NSS) include directory], +[ + if test -e "$withval"/nss.h + then + AC_MSG_RESULT([using $withval]) + nss_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-nss-lib +AC_MSG_CHECKING(for --with-nss-lib) +AC_ARG_WITH(nss-lib, [ --with-nss-lib=PATH Network Security Services (NSS) library directory], +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + nss_lib="-L$withval" + nss_libdir="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if NSS is not found yet, try pkg-config + +# last resort +if test -z "$nss_inc" -o -z "$nss_lib" -o -z "$nss_libdir"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config) + AC_MSG_CHECKING(for nss with pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists nss; then + nss_inc=`$PKG_CONFIG --cflags-only-I nss` + nss_lib=`$PKG_CONFIG --libs-only-L nss` + nss_libdir=`$PKG_CONFIG --libs-only-L nss | sed -e s/-L// | sed -e s/\ *$//` + 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` + nss_libdir=`$PKG_CONFIG --libs-only-L dirsec-nss | sed -e s/-L// | sed -e s/\ *$//` + AC_MSG_RESULT([using system dirsec NSS]) + else + AC_MSG_ERROR([NSS not found, specify with --with-nss.]) + fi + fi +fi diff --git a/pki/base/tps/m4/openldap.m4 b/pki/base/tps/m4/openldap.m4 new file mode 100644 index 000000000..b92b1990c --- /dev/null +++ b/pki/base/tps/m4/openldap.m4 @@ -0,0 +1,157 @@ +# BEGIN COPYRIGHT BLOCK +# Copyright (C) 2009 Red Hat, Inc. +# All rights reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# END COPYRIGHT BLOCK + +AC_CHECKING(for OpenLDAP) + +# check for --with-openldap +AC_MSG_CHECKING(for --with-openldap) +AC_ARG_WITH(openldap, AS_HELP_STRING([--with-openldap@<:@=PATH@:>@],[Use OpenLDAP - optional PATH is path to OpenLDAP SDK]), +[ + if test "$withval" = yes + then + AC_MSG_RESULT([using system OpenLDAP]) + elif test "$withval" = no + then + AC_MSG_RESULT(no) + elif test -e "$withval"/include/ldap.h -a -d "$withval"/lib + then + AC_MSG_RESULT([using $withval]) + OPENLDAPDIR=$withval + openldap_incdir="$OPENLDAPDIR/include" + openldap_inc="-I$openldap_incdir" + openldap_lib="-L$OPENLDAPDIR/lib" + openldap_libdir="$OPENLDAPDIR/lib" + openldap_bindir="$OPENLDAPDIR/bin" + with_openldap=yes + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-openldap-inc +AC_MSG_CHECKING(for --with-openldap-inc) +AC_ARG_WITH(openldap-inc, AS_HELP_STRING([--with-openldap-inc=PATH],[OpenLDAP SDK include directory]), +[ + if test -e "$withval"/ldap.h + then + AC_MSG_RESULT([using $withval]) + openldap_incdir="$withval" + openldap_inc="-I$withval" + with_openldap=yes + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-openldap-lib +AC_MSG_CHECKING(for --with-openldap-lib) +AC_ARG_WITH(openldap-lib, AS_HELP_STRING([--with-openldap-lib=PATH],[OpenLDAP SDK library directory]), +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + openldap_lib="-L$withval" + openldap_libdir="$withval" + with_openldap=yes + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# check for --with-openldap-bin +AC_MSG_CHECKING(for --with-openldap-bin) +AC_ARG_WITH(openldap-bin, AS_HELP_STRING([--with-openldap-bin=PATH],[OpenLDAP SDK binary directory]), +[ + if test -d "$withval" + then + AC_MSG_RESULT([using $withval]) + openldap_bindir="$withval" + with_openldap=yes + else + echo + AC_MSG_ERROR([$withval not found]) + fi +], +AC_MSG_RESULT(no)) + +# if OPENLDAP is not found yet, try pkg-config + +if test "$with_openldap" = yes ; then # user wants to use openldap, but didn't specify paths + if test -z "$openldap_inc" -o -z "$openldap_lib" -o -z "$openldap_libdir" -o -z "$openldap_bindir"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config) + AC_MSG_CHECKING(for OpenLDAP with pkg-config) + if test -n "$PKG_CONFIG" && $PKG_CONFIG --exists openldap; then + openldap_inc=`$PKG_CONFIG --cflags-only-I openldap` + openldap_lib=`$PKG_CONFIG --libs-only-L openldap` + openldap_libdir=`$PKG_CONFIG --libs-only-L openldap | sed -e s/-L// | sed -e s/\ .*$//` + openldap_bindir=`$PKG_CONFIG --variable=bindir openldap` + openldap_incdir=`$PKG_CONFIG --variable=includedir openldap` + AC_MSG_RESULT([using system OpenLDAP from pkg-config]) + else + openldap_incdir="/usr/include" + openldap_inc="-I$openldap_incdir" + AC_MSG_RESULT([no OpenLDAP pkg-config files]) + fi + fi +fi + +dnl lets see if we can find the headers and libs + +if test "$with_openldap" = yes ; then + save_cppflags="$CPPFLAGS" + CPPFLAGS="$openldap_inc $nss_inc $nspr_inc" + AC_CHECK_HEADER([ldap_features.h], [], + [AC_MSG_ERROR([specified with-openldap but ldap_features.h not found])]) + dnl figure out which version we're using from the header file + ol_ver_maj=`grep LDAP_VENDOR_VERSION_MAJOR $openldap_incdir/ldap_features.h | awk '{print $3}'` + ol_ver_min=`grep LDAP_VENDOR_VERSION_MINOR $openldap_incdir/ldap_features.h | awk '{print $3}'` + ol_ver_pat=`grep LDAP_VENDOR_VERSION_PATCH $openldap_incdir/ldap_features.h | awk '{print $3}'` + dnl full libname is libname-$maj.$min + ol_libver="-${ol_ver_maj}.${ol_ver_min}" + dnl look for ldap lib + save_ldflags="$LDFLAGS" + LDFLAGS="$openldap_lib $LDFLAGS" + AC_CHECK_LIB([ldap$ol_libver], [ldap_initialize], [have_ldap_lib=1]) + if test -z "$have_ldap_lib" ; then + AC_CHECK_LIB([ldap], [ldap_initialize], [unset ol_libver], + [AC_MSG_ERROR([specified with-openldap but libldap not found])]) + fi + dnl look for ldap_url_parse_ext + AC_CHECK_LIB([ldap$ol_libver], [ldap_url_parse_ext], + [AC_DEFINE([HAVE_LDAP_URL_PARSE_EXT], [1], [have the function ldap_url_parse_ext])]) + LDFLAGS="$save_ldflags" + CPPFLAGS="$save_cppflags" + + AC_DEFINE([USE_OPENLDAP], [1], [If defined, using OpenLDAP for LDAP SDK]) + # where to find ldapsearch, et. al. + ldaptool_bindir=$openldap_bindir + # default options to pass to the tools + # use -x because all of our scripts use simple bind + ldaptool_opts=-x + # get plain output from ldapsearch - no version, no comments + plainldif_opts=-LLL +fi + diff --git a/pki/base/tps/m4/sasl.m4 b/pki/base/tps/m4/sasl.m4 new file mode 100644 index 000000000..fb46c1ad6 --- /dev/null +++ b/pki/base/tps/m4/sasl.m4 @@ -0,0 +1,112 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +# Configure paths for SASL + +dnl ======================================================== +dnl = sasl is used to support various authentication mechanisms +dnl = such as DIGEST-MD5 and GSSAPI. +dnl ======================================================== +dnl ======================================================== +dnl = Use the sasl libraries on the system (assuming it exists) +dnl ======================================================== +AC_CHECKING(for sasl) + +AC_MSG_CHECKING(for --with-sasl) +AC_ARG_WITH(sasl, + [[ --with-sasl=PATH Use sasl from supplied path]], + dnl = Look in the standard system locations + [ + if test "$withval" = "yes"; then + AC_MSG_RESULT(yes) + + dnl = Check for sasl.h in the normal locations + if test -f /usr/include/sasl/sasl.h; then + sasl_inc="-I/usr/include/sasl" + elif test -f /usr/include/sasl.h; then + sasl_inc="-I/usr/include" + else + AC_MSG_ERROR(sasl.h not found) + fi + + dnl = Check the user provided location + elif test -d "$withval" -a -d "$withval/lib" -a -d "$withval/include" ; then + AC_MSG_RESULT([using $withval]) + + if test -f "$withval/include/sasl/sasl.h"; then + sasl_inc="-I$withval/include/sasl" + elif test -f "$withval/include/sasl.h"; then + sasl_inc="-I$withval/include" + else + AC_MSG_ERROR(sasl.h not found) + fi + + sasl_lib="-L$withval/lib" + sasl_libdir="$withval/lib" + else + AC_MSG_RESULT(yes) + AC_MSG_ERROR([sasl not found in $withval]) + fi + ], + AC_MSG_RESULT(no)) + +AC_MSG_CHECKING(for --with-sasl-inc) +AC_ARG_WITH(sasl-inc, + [[ --with-sasl-inc=PATH SASL include file directory]], + [ + if test -f "$withval"/sasl.h; then + AC_MSG_RESULT([using $withval]) + sasl_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval/sasl.h not found]) + fi + ], + AC_MSG_RESULT(no)) + +AC_MSG_CHECKING(for --with-sasl-lib) +AC_ARG_WITH(sasl-lib, + [[ --with-sasl-lib=PATH SASL library directory]], + [ + if test -d "$withval"; then + AC_MSG_RESULT([using $withval]) + sasl_lib="-L$withval" + sasl_libdir="$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi + ], + AC_MSG_RESULT(no)) + +if test -z "$sasl_inc"; then + AC_MSG_CHECKING(for sasl.h) + dnl - Check for sasl in standard system locations + if test -f /usr/include/sasl/sasl.h; then + AC_MSG_RESULT([using /usr/include/sasl/sasl.h]) + sasl_inc="-I/usr/include/sasl" + elif test -f /usr/include/sasl.h; then + AC_MSG_RESULT([using /usr/include/sasl.h]) + sasl_inc="-I/usr/include" + else + AC_MSG_RESULT(no) + AC_MSG_ERROR([sasl not found, specify with --with-sasl.]) + fi +fi diff --git a/pki/base/tps/m4/svrcore.m4 b/pki/base/tps/m4/svrcore.m4 new file mode 100644 index 000000000..14a5d387a --- /dev/null +++ b/pki/base/tps/m4/svrcore.m4 @@ -0,0 +1,113 @@ +dnl BEGIN COPYRIGHT BLOCK +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, +dnl Boston, MA 02110-1301 USA +dnl +dnl Copyright (C) 2007 Red Hat, Inc. +dnl All rights reserved. +dnl END COPYRIGHT BLOCK + +# Configure paths for SVRCORE +AC_CHECKING(for svrcore) + +AC_MSG_CHECKING(for --with-svrcore) +AC_ARG_WITH(svrcore, + [[ --with-svrcore[=PATH] Use system installed svrcore - optional path for svrcore]], + dnl = Look in the standard system locations + [ + if test "$withval" = "yes"; then + AC_MSG_RESULT(yes) + + dnl = Check for svrcore.h in the normal locations + if test -f /usr/include/svrcore.h; then + svrcore_inc="-I/usr/include" + else + AC_MSG_ERROR(svrcore.h not found) + fi + + dnl = Check the user provided location + elif test -d "$withval" -a -d "$withval/lib" -a -d "$withval/include" ; then + AC_MSG_RESULT([using $withval]) + + if test -f "$withval/include/svrcore.h"; then + svrcore_inc="-I$withval/include" + else + AC_MSG_ERROR(svrcore.h not found) + fi + + svrcore_lib="-L$withval/lib" + else + AC_MSG_RESULT(yes) + AC_MSG_ERROR([svrcore not found in $withval]) + fi + ], + AC_MSG_RESULT(no)) + +AC_MSG_CHECKING(for --with-svrcore-inc) +AC_ARG_WITH(svrcore-inc, + [[ --with-svrcore-inc=PATH SVRCORE include file directory]], + [ + if test -f "$withval"/svrcore.h; then + AC_MSG_RESULT([using $withval]) + svrcore_inc="-I$withval" + else + echo + AC_MSG_ERROR([$withval/svrcore.h not found]) + fi + ], + AC_MSG_RESULT(no)) + +AC_MSG_CHECKING(for --with-svrcore-lib) +AC_ARG_WITH(svrcore-lib, + [[ --with-svrcore-lib=PATH SVRCORE library directory]], + [ + if test -d "$withval"; then + AC_MSG_RESULT([using $withval]) + svrcore_lib="-L$withval" + else + echo + AC_MSG_ERROR([$withval not found]) + fi + ], + AC_MSG_RESULT(no)) + +dnl svrcore not given - look for pkg-config +if test -z "$svrcore_inc" -o -z "$svrcore_lib"; then + AC_PATH_PROG(PKG_CONFIG, pkg-config) + AC_MSG_CHECKING(for svrcore with pkg-config) + if test -n "$PKG_CONFIG"; then + if $PKG_CONFIG --exists svrcore; then + svrcore_inc=`$PKG_CONFIG --cflags-only-I svrcore` + svrcore_lib=`$PKG_CONFIG --libs-only-L svrcore` + 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 |