Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-10-03 23:57:11 +0200
committerArthur de Jong <arthur@arthurdejong.org>2010-10-03 23:57:11 +0200
commitbebac035f67df5083daba4613c77cbc412faee86 (patch)
treea19f3e450cc3581bf88d02f5cc7fbaee0d7b623c /configure.ac
parent7d3e113db9f89f3ed2fbe3854bd9e441a460483b (diff)
first attempt to split Solaris and Glibc code more and determine NSS flavour in configure script
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1236 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac50
1 files changed, 42 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 32b4bb7..f6c65b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -217,11 +217,20 @@ AC_DEFINE_UNQUOTED(PAM_SECLIB_DIR,"$PAM_SECLIB_DIR",[path to PAM security librar
AC_SUBST(PAM_SECLIB_DIR)
# the SONAME to use for the NSS module
+AC_MSG_CHECKING([name of NSS module])
AC_ARG_WITH(nss-ldap-soname,
AS_HELP_STRING([--with-nss-ldap-soname=SONAME],
- [name of NSS module @<:@libnss_ldap.so.2@:>@]),
+ [name of NSS module @<:@auto@:>@]),
[ NSS_LDAP_SONAME="$with_nss_ldap_soname" ],
- [ NSS_LDAP_SONAME="libnss_ldap.so.2" ])
+ [ NSS_LDAP_SONAME="auto" ])
+if test "x$NSS_LDAP_SONAME" = "xauto"
+then
+ case "$target_os" in
+ solaris*) NSS_LDAP_SONAME="nss_ldap.so.1" ;;
+ *) NSS_LDAP_SONAME="libnss_ldap.so.2" ;;
+ esac
+fi
+AC_MSG_RESULT($NSS_LDAP_SONAME)
AC_DEFINE_UNQUOTED(NSS_LDAP_SONAME,"$NSS_LDAP_SONAME",[The SONAME of the NSS library module.])
AC_SUBST(NSS_LDAP_SONAME)
@@ -335,15 +344,44 @@ then
#include <rpc/rpcent.h>
#endif])
- # check for a definition of enum nss_status
- AC_CHECK_TYPES(enum nss_status,,,[
+ # check for a definition of enum nss_status and nss_backend_t
+ AC_CHECK_TYPES([enum nss_status,nss_backend_t],,,[
#ifdef HAVE_NSS_H
#include <nss.h>
#endif
#ifdef HAVE_NSS_COMMON_H
#include <nss_common.h>
+ #endif
+ #ifdef HAVE_NSS_DBDEFS_H
+ #include <nss_dbdefs.h>
+ #endif
+ #ifdef HAVE_NSSWITCH_H
+ #include <nsswitch.h>
+ #endif
+ #ifdef HAVE_IRS_NSS_H
+ #include "irs-nss.h"
#endif])
+ # check which NSS flavour to build
+ AC_MSG_CHECKING([which NSS flavour to build])
+ AC_ARG_WITH(nss-flavour,
+ AS_HELP_STRING([--with-nss-flavour=auto|glibc|solaris],
+ [the libc flavour to build our NSS module for @<:@auto@:>@]),,
+ with_nss_flavour=auto)
+ if test "x$with_nss_flavour" = "xauto"
+ then
+ # do the guessing game
+ case "$target_os" in
+ solaris*) with_nss_flavour=solaris ;;
+ *) with_nss_flavour=glibc ;;
+ esac
+ fi
+ AC_MSG_RESULT($with_nss_flavour)
+ case "$with_nss_flavour" in
+ glibc) AC_DEFINE(NSS_FLAVOUR_GLIBC,1,[Whether to use the Glibc NSS interface flavour.]) ;;
+ solaris) AC_DEFINE(NSS_FLAVOUR_SOLARIS,1,[Whether to use the Solaris NSS interface flavour.]) ;;
+ esac
+
# check which module source files to use
AC_MSG_CHECKING([which NSS maps to build])
if test "x$with_nss_ldap_maps" = "xall"
@@ -616,23 +654,19 @@ solaris*) if test "$ac_cv_prog_gcc" = yes; then
fi
nss_ldap_so_LDFLAGS="-Bdirect -z nodelete -Bdynamic -M \$(srcdir)/exports.solaris -G"
pam_ldap_so_LDFLAGS="-Bdirect -z nodelete -Bdynamic -M \$(srcdir)/exports.solaris -G"
- NSS_LDAP_SONAME="nss_ldap.so.1"
pam_ldap_so_VERSIONED="pam_ldap.so.1"
TARGET_OS="SUNOS" ;;
linux*) nss_ldap_so_LDFLAGS="-shared -Wl,-Bdynamic -Wl,--version-script,\$(srcdir)/exports.linux"
pam_ldap_so_LDFLAGS="-shared -Wl,-Bdynamic -Wl,--version-script,\$(srcdir)/exports.linux"
- NSS_LDAP_SONAME="libnss_ldap.so.2"
pam_ldap_so_VERSIONED="pam_ldap.so"
TARGET_OS="LINUX" ;;
*) nss_ldap_so_LDFLAGS="-shared -Wl,-Bdynamic"
pam_ldap_so_LDFLAGS="-shared -Wl,-Bdynamic"
- NSS_LDAP_SONAME="nss_ldap.so.1"
pam_ldap_so_VERSIONED="pam_ldap.so" ;;
esac
AC_SUBST(nss_ldap_so_LD)
AC_SUBST(nss_ldap_so_LDFLAGS)
-AC_SUBST(NSS_LDAP_SONAME)
AC_SUBST(pam_ldap_so_LD)
AC_SUBST(pam_ldap_so_LDFLAGS)