summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur de Jong <arthur@arthurdejong.org>2010-06-15 19:53:06 +0000
committerArthur de Jong <arthur@arthurdejong.org>2010-06-15 19:53:06 +0000
commit7859f07ecf0d5797d2077eeec3dd0f201aa83010 (patch)
treecc94e7af7774b1bddcf0f113a7ed29e613d7f650
parentca72ff2dcd29f8573ee44b77e66994c880481ba5 (diff)
rename symbol map files and check for the linker option to specify the file with
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1143 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r--configure.ac17
-rw-r--r--nss/Makefile.am8
-rw-r--r--nss/nss_ldap.map (renamed from nss/exports.linux)0
-rw-r--r--pam/Makefile.am9
-rw-r--r--pam/pam_ldap.map (renamed from pam/exports.linux)0
5 files changed, 28 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 28d3a3f..b27e24c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -238,6 +238,23 @@ 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_TYPE(struct ether_addr,
AC_DEFINE(HAVE_STRUCT_ETHER_ADDR,1,[Define to 1 if you have a `struct ether_addr' definition.]),,[
diff --git a/nss/Makefile.am b/nss/Makefile.am
index 89d9a4e..d373dc9 100644
--- a/nss/Makefile.am
+++ b/nss/Makefile.am
@@ -34,11 +34,13 @@ nss_ldap_so_SOURCES = common.c common.h prototypes.h \
aliases.c ethers.c group.c hosts.c netgroup.c \
networks.c passwd.c protocols.c rpc.c services.c \
shadow.c
-nss_ldap_so_LDFLAGS = -shared -Wl,-soname,$(NSS_LDAP_NSS_VERSIONED) \
- -Wl,--version-script,\$(srcdir)/exports.linux
+nss_ldap_so_LDFLAGS = -shared -Wl,-soname,$(NSS_LDAP_NSS_VERSIONED)
+if HAVE_VERSION_SCRIPT_FLAG
+nss_ldap_so_LDFLAGS += $(VERSION_SCRIPT_FLAG)\$(srcdir)/nss_ldap.map
+endif
nss_ldap_so_LDADD = ../common/libtio.a ../common/libprot.a
-EXTRA_DIST = exports.linux
+EXTRA_DIST = nss_ldap.map
install-exec-local: install-nss_ldap_so
uninstall-local: uninstall-nss_ldap_so
diff --git a/nss/exports.linux b/nss/nss_ldap.map
index 0ed5ea2..0ed5ea2 100644
--- a/nss/exports.linux
+++ b/nss/nss_ldap.map
diff --git a/pam/Makefile.am b/pam/Makefile.am
index 65decb7..8bdd411 100644
--- a/pam/Makefile.am
+++ b/pam/Makefile.am
@@ -1,6 +1,6 @@
# Makefile.am - use automake to generate Makefile.in
#
-# Copyright (C) 2009 Arthur de Jong
+# Copyright (C) 2009, 2010 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -24,11 +24,14 @@ AM_CFLAGS = -fPIC
pam_ldap_so_SOURCES = ../nslcd.h ../common/nslcd-prot.h \
../compat/attrs.h pam.c common.h
-pam_ldap_so_LDFLAGS = -shared -Wl,--version-script,\$(srcdir)/exports.linux
+pam_ldap_so_LDFLAGS = -shared
+if HAVE_VERSION_SCRIPT_FLAG
+pam_ldap_so_LDFLAGS += $(VERSION_SCRIPT_FLAG)\$(srcdir)/pam_ldap.map
+endif
pam_ldap_so_LDADD = ../common/libtio.a ../common/libprot.a -lpam \
../compat/libcompat.a
-EXTRA_DIST = exports.linux
+EXTRA_DIST = pam_ldap.map
install-exec-local: install-pam_ldap_so
uninstall-local: uninstall-pam_ldap_so
diff --git a/pam/exports.linux b/pam/pam_ldap.map
index 21c98f8..21c98f8 100644
--- a/pam/exports.linux
+++ b/pam/pam_ldap.map