Add support for native MacOS X pam header location

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1325 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aet 2003-08-04 15:11:27 +00:00
parent 1091548eda
commit d44719457b
3 changed files with 18 additions and 23 deletions

View File

@ -224,7 +224,7 @@ dnl Automatically update the libtool script if it becomes out-of-date.
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([errno.h fcntl.h malloc.h stdlib.h string.h strings.h sys/time.h unistd.h libgen.h utmp.h getopt.h dlfcn.h security/pam_appl.h security/_pam_macros.h])
AC_CHECK_HEADERS([errno.h fcntl.h malloc.h stdlib.h string.h strings.h sys/time.h unistd.h libgen.h utmp.h getopt.h dlfcn.h security/pam_appl.h security/_pam_macros.h pam/pam_appl.h pam/_pam_macros.h])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@ -739,7 +739,7 @@ AC_ARG_WITH(pam,
],
)
if test -z "$no_pam" ; then
if test "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then
if test "x$ac_cv_header_security_pam_appl_h" = "xyes" -o "x$ac_cv_header_pam_pam_appl_h" = "xyes"; then
AC_MSG_RESULT(yes)
PAM_MSG="yes"
AC_CHECK_LIB(pam, pam_set_item, [LIBPAM="$LIBPAM -lpam"], AC_MSG_ERROR([*** libpam missing]))
@ -752,25 +752,6 @@ if test -z "$no_pam" ; then
AC_MSG_RESULT(no)
fi
fi
dnl Check for older PAM
if test "x$PAM_MSG" = "xyes" ; then
# Check PAM strerror arguments (old PAM)
AC_MSG_CHECKING([whether pam_strerror takes only one argument])
AC_TRY_COMPILE(
[
#include <stdlib.h>
#include <security/pam_appl.h>
],
[(void)pam_strerror((pam_handle_t *)NULL, -1);],
[AC_MSG_RESULT(no)],
[
AC_DEFINE(HAVE_OLD_PAM, 1, [Have OLD Pluggable Authentication Modules])
AC_MSG_RESULT(yes)
PAM_MSG="yes (old library)"
]
)
fi
LIBS="$saved_LIBS"
AM_CONDITIONAL(HAVE_PAM, test "x$PAM_MSG" = "xyes")
@ -1269,8 +1250,11 @@ echo "OpenCT support: ${OPENCT_MSG}"
echo "Assuan support: ${ASSUAN_MSG}"
echo "LDAP support: ${LDAP_MSG}"
echo "PAM support: ${PAM_MSG}"
echo "SIA support: ${SIA_MSG}"
case "$host" in
*osf*)
echo "SIA support: ${SIA_MSG}"
;;
esac
echo ""
if test "x$ENGINE_MSG" = "xno" -a "x$SSL_MSG" = "xyes"

View File

@ -21,7 +21,11 @@
#include <unistd.h>
#endif
#ifdef HAVE_SECURITY_PAM_APPL_H
#include <security/pam_appl.h>
#else
#include <pam/pam_appl.h>
#endif
#include "pam_support.h"
#undef D

View File

@ -24,10 +24,17 @@
#define _PAM_SUPPORT_H
#include <syslog.h>
#ifdef HAVE_SECURITY_PAM_APPL_H
#include <security/pam_appl.h>
#include <security/pam_modules.h>
#else
#include <pam/pam_appl.h>
#include <pam/pam_modules.h>
#endif
#ifdef HAVE_SECURITY__PAM_MACROS_H
#include <security/_pam_macros.h>
#elif HAVE_PAM__PAM_MACROS_H
#include <pam/_pam_macros.h>
#else
#define x_strdup(s) ((s) ? strdup(s):NULL)
#define _pam_overwrite(x) \