From 40421dc3652ce39150a79a1c75f6ddc20839b9de Mon Sep 17 00:00:00 2001 From: Arthur de Jong Date: Sun, 10 Oct 2010 19:18:43 +0000 Subject: put all locgic on how to link in configure script (remove stuff from Makefile.ams) and make choice for NSS and PAM components independently (renaming and removing version scripts as needed) git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd-solaris@1250 ef36b2f9-881f-0410-afb5-c4e39611909c --- configure.ac | 77 ++++++++++++++++++---------------------------- nss/Makefile.am | 13 +------- nss/exports.glibc | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++ nss/nss_ldap.map | 88 ----------------------------------------------------- pam/Makefile.am | 8 +---- pam/exports.solaris | 16 ---------- 6 files changed, 120 insertions(+), 170 deletions(-) create mode 100644 nss/exports.glibc delete mode 100644 nss/nss_ldap.map delete mode 100644 pam/exports.solaris diff --git a/configure.ac b/configure.ac index edc675c..61cb551 100644 --- a/configure.ac +++ b/configure.ac @@ -298,23 +298,6 @@ then AC_DEFINE(__thread,,[Define to empty if compiler does not support `__thread' keyword.]) fi -# check how to pass a symbol map to the linker -AC_MSG_CHECKING([how linker wants the symbol map]) -if $CC -Wl,--help 2>&1 | grep -- --version-script >/dev/null -then - VERSION_SCRIPT_FLAG="-Wl,--version-script," - AC_SUBST(VERSION_SCRIPT_FLAG) - AC_MSG_RESULT([--version-script]) -elif $CC -Wl,--help 2>&1 | grep -- '-M mapfile' >/dev/null -then - VERSION_SCRIPT_FLAG="-Wl,-M," - AC_SUBST(VERSION_SCRIPT_FLAG) - AC_MSG_RESULT([-M]) -else - AC_MSG_RESULT([unknown, not passing symbol map]) -fi -AM_CONDITIONAL([HAVE_VERSION_SCRIPT_FLAG], [test "x${VERSION_SCRIPT_FLAG}" != x]) - # check for support for the struct ether_addr structure AC_CHECK_TYPES(struct ether_addr,,,[ #include @@ -427,6 +410,21 @@ then NSS_MODULE_OBJS="`echo "$with_nss_ldap_maps " | sed 's/,/ /g;s/ */.$(OBJEXT) /g'`" AC_SUBST(NSS_MODULE_OBJS) + # find out how to link the library + case "$target_os" in + solaris*) + if test "$ac_cv_prog_gcc" = yes; then + nss_ldap_so_LD="/usr/ccs/bin/ld" + AC_SUBST(nss_ldap_so_LD) + fi + nss_ldap_so_LDFLAGS="-Bdirect -z nodelete -Bdynamic -M \$(srcdir)/exports.solaris -G" + ;; + *) + nss_ldap_so_LDFLAGS="-shared -Wl,-h,\$(NSS_LDAP_SONAME) -Wl,--version-script,\$(srcdir)/exports.glibc" + ;; + esac + AC_SUBST(nss_ldap_so_LDFLAGS) + # restore CFLAGS and LIBS CFLAGS="$nss_save_CFLAGS" LIBS="$nss_save_LIBS" @@ -464,6 +462,21 @@ then AC_REPLACE_FUNCS(pam_get_authtok pam_prompt) AC_CHECK_FUNCS(pam_modutil_getpwnam pam_syslog) + # find out how to link the library + case "$target_os" in + solaris*) + if test "$ac_cv_prog_gcc" = yes; then + pam_ldap_so_LD="/usr/ccs/bin/ld" + AC_SUBST(pam_ldap_so_LD) + fi + pam_ldap_so_LDFLAGS="-Bdirect -z nodelete -Bdynamic -M \$(srcdir)/pam_ldap.map -G" + ;; + *) + pam_ldap_so_LDFLAGS="-shared -Wl,--version-script,\$(srcdir)/pam_ldap.map" + ;; + esac + AC_SUBST(pam_ldap_so_LDFLAGS) + # restore CFLAGS and LIBS CFLAGS="$pam_save_CFLAGS" LIBS="$pam_save_LIBS" @@ -680,36 +693,6 @@ then AC_SUBST(nslcd_LIBS) fi -# Always use native linker on Solaris -# but only invoke directly if compiling with gcc (?) -case "$target_os" in -solaris*) if test "$ac_cv_prog_gcc" = yes; then - nss_ldap_so_LD="/usr/ccs/bin/ld" - pam_ldap_so_LD="/usr/ccs/bin/ld" - 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" - 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" - TARGET_OS="LINUX" ;; -*) nss_ldap_so_LDFLAGS="-shared -Wl,-Bdynamic" - pam_ldap_so_LDFLAGS="-shared -Wl,-Bdynamic" -esac - -AC_SUBST(nss_ldap_so_LD) -AC_SUBST(nss_ldap_so_LDFLAGS) - -AC_SUBST(pam_ldap_so_LD) -AC_SUBST(pam_ldap_so_LDFLAGS) - -AC_SUBST(AIX64SUFFIX) -AM_CONDITIONAL(GCC, test "$GCC" = "yes") -AM_CONDITIONAL(GLIBC, test "$target_os" = "linux" -o "$target_os" = "linux-gnu") -AM_CONDITIONAL(USE_NATIVE_LINKER, test -n "$nss_ldap_so_LD") -AM_CONDITIONAL(SUNOS, test "x${TARGET_OS}" = "xSUNOS") -AM_CONDITIONAL(LINUX, test "x${TARGET_OS}" = "xLINUX") - # generate files AC_CONFIG_FILES([Makefile compat/Makefile common/Makefile nss/Makefile pam/Makefile nslcd/Makefile man/Makefile tests/Makefile]) diff --git a/nss/Makefile.am b/nss/Makefile.am index bd89de4..712c20e 100644 --- a/nss/Makefile.am +++ b/nss/Makefile.am @@ -34,18 +34,7 @@ EXTRA_nss_ldap_so_SOURCES = aliases.c ethers.c group.c hosts.c netgroup.c \ nss_ldap_so_DEPENDENCIES = $(NSS_MODULE_OBJS) nss_ldap_so_LDADD = ../common/libtio.a ../common/libprot.a $(NSS_MODULE_OBJS) -nss_ldap_so_LDFLAGS = @nss_ldap_so_LDFLAGS@ -if HAVE_VERSION_SCRIPT_FLAG -nss_ldap_so_LDFLAGS += $(VERSION_SCRIPT_FLAG)\$(srcdir)/nss_ldap.map -endif - -if USE_NATIVE_LINKER -nss_ldap_so_LINK = @nss_ldap_so_LD@ @nss_ldap_so_LDFLAGS@ -o $@ -else -nss_ldap_so_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAG) -o $@ -endif - -EXTRA_DIST = nss_ldap.map +EXTRA_DIST = exports.glibc exports.solaris install-exec-local: install-nss_ldap_so uninstall-local: uninstall-nss_ldap_so diff --git a/nss/exports.glibc b/nss/exports.glibc new file mode 100644 index 0000000..0ed5ea2 --- /dev/null +++ b/nss/exports.glibc @@ -0,0 +1,88 @@ +EXPORTED { + + # published NSS service functions + global: + + # flag to enable or disable lookups + _nss_ldap_enablelookups; + + # aliases - mail aliases + _nss_ldap_getaliasbyname_r; + _nss_ldap_setaliasent; + _nss_ldap_getaliasent_r; + _nss_ldap_endaliasent; + + # ethers - ethernet numbers + _nss_ldap_gethostton_r; + _nss_ldap_getntohost_r; + _nss_ldap_setetherent; + _nss_ldap_getetherent_r; + _nss_ldap_endetherent; + + # group - groups of users + _nss_ldap_getgrnam_r; + _nss_ldap_getgrgid_r; + _nss_ldap_initgroups_dyn; + _nss_ldap_setgrent; + _nss_ldap_getgrent_r; + _nss_ldap_endgrent; + + # hosts - host names and numbers + _nss_ldap_gethostbyname_r; + _nss_ldap_gethostbyname2_r; + _nss_ldap_gethostbyaddr_r; + _nss_ldap_sethostent; + _nss_ldap_gethostent_r; + _nss_ldap_endhostent; + + # netgroup - list of host and users + _nss_ldap_setnetgrent; + _nss_ldap_getnetgrent_r; + _nss_ldap_endnetgrent; + + # networks - network names and numbers + _nss_ldap_getnetbyname_r; + _nss_ldap_getnetbyaddr_r; + _nss_ldap_setnetent; + _nss_ldap_getnetent_r; + _nss_ldap_endnetent; + + # passwd - user database and passwords + _nss_ldap_getpwnam_r; + _nss_ldap_getpwuid_r; + _nss_ldap_setpwent; + _nss_ldap_getpwent_r; + _nss_ldap_endpwent; + + # protocols - network protocols + _nss_ldap_getprotobyname_r; + _nss_ldap_getprotobynumber_r; + _nss_ldap_setprotoent; + _nss_ldap_getprotoent_r; + _nss_ldap_endprotoent; + + # rpc - remote procedure call names and numbers + _nss_ldap_getrpcbyname_r; + _nss_ldap_getrpcbynumber_r; + _nss_ldap_setrpcent; + _nss_ldap_getrpcent_r; + _nss_ldap_endrpcent; + + # services - network services + _nss_ldap_getservbyname_r; + _nss_ldap_getservbyport_r; + _nss_ldap_setservent; + _nss_ldap_getservent_r; + _nss_ldap_endservent; + + # shadow - extended user information + _nss_ldap_getspnam_r; + _nss_ldap_setspent; + _nss_ldap_getspent_r; + _nss_ldap_endspent; + + # everything else should not be exported + local: + *; + +}; diff --git a/nss/nss_ldap.map b/nss/nss_ldap.map deleted file mode 100644 index 0ed5ea2..0000000 --- a/nss/nss_ldap.map +++ /dev/null @@ -1,88 +0,0 @@ -EXPORTED { - - # published NSS service functions - global: - - # flag to enable or disable lookups - _nss_ldap_enablelookups; - - # aliases - mail aliases - _nss_ldap_getaliasbyname_r; - _nss_ldap_setaliasent; - _nss_ldap_getaliasent_r; - _nss_ldap_endaliasent; - - # ethers - ethernet numbers - _nss_ldap_gethostton_r; - _nss_ldap_getntohost_r; - _nss_ldap_setetherent; - _nss_ldap_getetherent_r; - _nss_ldap_endetherent; - - # group - groups of users - _nss_ldap_getgrnam_r; - _nss_ldap_getgrgid_r; - _nss_ldap_initgroups_dyn; - _nss_ldap_setgrent; - _nss_ldap_getgrent_r; - _nss_ldap_endgrent; - - # hosts - host names and numbers - _nss_ldap_gethostbyname_r; - _nss_ldap_gethostbyname2_r; - _nss_ldap_gethostbyaddr_r; - _nss_ldap_sethostent; - _nss_ldap_gethostent_r; - _nss_ldap_endhostent; - - # netgroup - list of host and users - _nss_ldap_setnetgrent; - _nss_ldap_getnetgrent_r; - _nss_ldap_endnetgrent; - - # networks - network names and numbers - _nss_ldap_getnetbyname_r; - _nss_ldap_getnetbyaddr_r; - _nss_ldap_setnetent; - _nss_ldap_getnetent_r; - _nss_ldap_endnetent; - - # passwd - user database and passwords - _nss_ldap_getpwnam_r; - _nss_ldap_getpwuid_r; - _nss_ldap_setpwent; - _nss_ldap_getpwent_r; - _nss_ldap_endpwent; - - # protocols - network protocols - _nss_ldap_getprotobyname_r; - _nss_ldap_getprotobynumber_r; - _nss_ldap_setprotoent; - _nss_ldap_getprotoent_r; - _nss_ldap_endprotoent; - - # rpc - remote procedure call names and numbers - _nss_ldap_getrpcbyname_r; - _nss_ldap_getrpcbynumber_r; - _nss_ldap_setrpcent; - _nss_ldap_getrpcent_r; - _nss_ldap_endrpcent; - - # services - network services - _nss_ldap_getservbyname_r; - _nss_ldap_getservbyport_r; - _nss_ldap_setservent; - _nss_ldap_getservent_r; - _nss_ldap_endservent; - - # shadow - extended user information - _nss_ldap_getspnam_r; - _nss_ldap_setspent; - _nss_ldap_getspent_r; - _nss_ldap_endspent; - - # everything else should not be exported - local: - *; - -}; diff --git a/pam/Makefile.am b/pam/Makefile.am index e6674fe..dca583f 100644 --- a/pam/Makefile.am +++ b/pam/Makefile.am @@ -28,13 +28,7 @@ pam_ldap_so_SOURCES = ../nslcd.h ../common/nslcd-prot.h \ pam_ldap_so_LDADD = ../common/libtio.a ../common/libprot.a -lpam \ ../compat/libcompat.a -if USE_NATIVE_LINKER -pam_ldap_so_LINK = @pam_ldap_so_LD@ @pam_ldap_so_LDFLAGS@ -o $@ -else -pam_ldap_so_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAG) -o $@ -endif - -EXTRA_DIST = pam_ldap.map exports.solaris +EXTRA_DIST = pam_ldap.map install-exec-local: install-pam_ldap_so uninstall-local: uninstall-pam_ldap_so diff --git a/pam/exports.solaris b/pam/exports.solaris deleted file mode 100644 index 02bcf2a..0000000 --- a/pam/exports.solaris +++ /dev/null @@ -1,16 +0,0 @@ -pam_ldap.so { - - # published PAM service functions - global: - pam_sm_acct_mgmt; - pam_sm_authenticate; - pam_sm_chauthtok; - pam_sm_close_session; - pam_sm_open_session; - pam_sm_setcred; - - # everything else should not be exported - local: - *; - -}; -- cgit v1.2.3