With this change, all tokens are built properly as plugins, and they
get their libraries linked in on the right variable. Finally, it only
exports the symbols that are actually loaded by libopencryptoki.
---
 defs.am                                   |    2 ++
 token.syms                                |    3 +++
 usr/lib/pkcs11/aep_stdll/Makefile.am      |    7 ++++---
 usr/lib/pkcs11/bcom_stdll/Makefile.am     |    7 ++++---
 usr/lib/pkcs11/cca_stdll/Makefile.am      |    6 ++++--
 usr/lib/pkcs11/cr_stdll/Makefile.am       |    7 ++++---
 usr/lib/pkcs11/ica_s390_stdll/Makefile.am |    7 ++++---
 usr/lib/pkcs11/ica_stdll/Makefile.am      |    7 ++++---
 usr/lib/pkcs11/leeds_stdll/Makefile.am    |    6 ++++--
 usr/lib/pkcs11/soft_stdll/Makefile.am     |    6 ++++--
 usr/lib/pkcs11/tpm_stdll/Makefile.am      |    6 ++++--
 11 files changed, 41 insertions(+), 23 deletions(-)
 create mode 100644 defs.am
 create mode 100644 token.syms

diff --git a/defs.am b/defs.am
new file mode 100644
index 0000000..08ec21c
--- /dev/null
+++ b/defs.am
@@ -0,0 +1,2 @@
+TOKEN_LDFLAGS = -export-dynamic -module -shared -avoid-version \
+       -export-symbols $(top_srcdir)/token.syms
diff --git a/token.syms b/token.syms
new file mode 100644
index 0000000..74e88f0
--- /dev/null
+++ b/token.syms
@@ -0,0 +1,3 @@
+SC_CloseAllSessions
+SC_Finalize
+ST_Initialize
diff --git a/usr/lib/pkcs11/aep_stdll/Makefile.am 
b/usr/lib/pkcs11/aep_stdll/Makefile.am
index d6a0add..c43699a 100644
--- a/usr/lib/pkcs11/aep_stdll/Makefile.am
+++ b/usr/lib/pkcs11/aep_stdll/Makefile.am
@@ -1,8 +1,9 @@
+include $(top_srcdir)/defs.am
+
 stdll_LTLIBRARIES = libpkcs11_aep.la
 
-libpkcs11_aep_la_LDFLAGS = $(LCRYPTO)          \
-$(AEP_LIB_DIRS) -nostartfiles -shared -lc      \
--lpthread -lcrypto -laep
+libpkcs11_aep_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_aep_la_LIBADD = -lpthread -lcrypto -laep
 
 libpkcs11_aep_la_CFLAGS = -DSPINXPL -DDEV              \
 -D_THREAD_SAFE -fPIC -DSHALLOW=0 -DSWTOK=1 -DLITE=0 -DNOCDMF -DNOMD2   \
diff --git a/usr/lib/pkcs11/bcom_stdll/Makefile.am 
b/usr/lib/pkcs11/bcom_stdll/Makefile.am
index eab4c4c..61dc4ea 100644
--- a/usr/lib/pkcs11/bcom_stdll/Makefile.am
+++ b/usr/lib/pkcs11/bcom_stdll/Makefile.am
@@ -1,8 +1,9 @@
+include $(top_srcdir)/defs.am
+
 stdll_LTLIBRARIES = libpkcs11_bc.la
 
-libpkcs11_bc_la_LDFLAGS = $(LCRYPTO) $(BC_LIB_DIRS)    \
--nostartfiles -shared -Wl,-Bsymbolic -lc       \
--lpthread -lubsec -ldl
+libpkcs11_bc_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_bc_la_LIBADD = -lpthread -lubsec -ldl
 
 VARIANT = -DSHALLOW=0 -DSWTOK=1 -DLITE=0
 
diff --git a/usr/lib/pkcs11/cca_stdll/Makefile.am 
b/usr/lib/pkcs11/cca_stdll/Makefile.am
index dc3cc6f..0cfbe94 100644
--- a/usr/lib/pkcs11/cca_stdll/Makefile.am
+++ b/usr/lib/pkcs11/cca_stdll/Makefile.am
@@ -1,6 +1,8 @@
 # Makefile.am for common functions for openCryptoki
 # Michael A. Halcrow <[email protected]>
 
+include $(top_srcdir)/defs.am
+
 #
 # The PKCS#11 STDLL library
 #
@@ -11,8 +13,8 @@ libpkcs11_cca_la_CFLAGS = -DLINUX -DSPINXPL -DNOCDMF  \
        -I. -I../../../include  -I../../../include/pkcs11 -I../common   \
        -DSTDLL_NAME=\"ccatok\"
 
-libpkcs11_cca_la_LDFLAGS = -shared -Wl,-Bsymbolic      \
-       -lcrypto -lpthread -nostartfiles
+libpkcs11_cca_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_cca_la_LIBADD = -lcrypto -lpthread
 
 libpkcs11_cca_la_SOURCES = asn1.c                      \
                                              ../common/btree.c         \
diff --git a/usr/lib/pkcs11/cr_stdll/Makefile.am 
b/usr/lib/pkcs11/cr_stdll/Makefile.am
index f326c74..1ab121f 100644
--- a/usr/lib/pkcs11/cr_stdll/Makefile.am
+++ b/usr/lib/pkcs11/cr_stdll/Makefile.am
@@ -1,8 +1,9 @@
+include $(top_srcdir)/defs.am
+
 stdll_LTLIBRARIES = libpkcs11_cr.la
 
-libpkcs11_cr_la_LDFLAGS = $(LCRYPTO) $(CR_LIB_DIRS)    \
--nostartfiles -shared -Wl,-Bsymbolic -lc       \
--lpthread -lsocketarmor -ldl -lcrypto
+libpkcs11_cr_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_cr_la_LIBADD = -lpthread -lsocketarmor -ldl -lcrypto
 
 VARIANT = -DSHALLOW=0 -DSWTOK=1 -DLITE=0
 
diff --git a/usr/lib/pkcs11/ica_s390_stdll/Makefile.am 
b/usr/lib/pkcs11/ica_s390_stdll/Makefile.am
index dd7f9ee..a4d99dc 100644
--- a/usr/lib/pkcs11/ica_s390_stdll/Makefile.am
+++ b/usr/lib/pkcs11/ica_s390_stdll/Makefile.am
@@ -1,8 +1,9 @@
+include $(top_srcdir)/defs.am
+
 stdll_LTLIBRARIES = libpkcs11_ica.la
 
-libpkcs11_ica_la_LDFLAGS = $(LCRYPTO)          \
-$(ICA_LIB_DIRS) -nostartfiles -shared -Wl,-Bsymbolic   \
--Wl,-Bsymbolic -lc -lpthread -lica -ldl -lcrypto
+libpkcs11_ica_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_ica_la_LIBADD = -lpthread -lica -ldl -lcrypto
 
 libpkcs11_ica_la_CFLAGS = -DSPINXPL -DDEV              \
 -D_THREAD_SAFE -fPIC -DSHALLOW=0 -DSWTOK=0 -DLITE=1 -DNODH             \
diff --git a/usr/lib/pkcs11/ica_stdll/Makefile.am 
b/usr/lib/pkcs11/ica_stdll/Makefile.am
index daae261..dda1121 100644
--- a/usr/lib/pkcs11/ica_stdll/Makefile.am
+++ b/usr/lib/pkcs11/ica_stdll/Makefile.am
@@ -1,8 +1,9 @@
+include $(top_srcdir)/defs.am
+
 stdll_LTLIBRARIES = libpkcs11_ica.la
 
-libpkcs11_ica_la_LDFLAGS = $(LCRYPTO)  \
-$(ICA_LIB_DIRS) -nostartfiles -shared -Wl,-Bsymbolic           \
--lc -lpthread -ldl -lica
+libpkcs11_ica_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_ica_la_LIBADD = -lpthread -ldl -lica
 
 libpkcs11_ica_la_CFLAGS = -DSPINXPL -DDEV              \
 -D_THREAD_SAFE -fPIC -DSHALLOW=0 -DSWTOK=0 -DLITE=1 -DNOCDMF -DNOMD2   \
diff --git a/usr/lib/pkcs11/leeds_stdll/Makefile.am 
b/usr/lib/pkcs11/leeds_stdll/Makefile.am
index 91a638a..ebc4b43 100644
--- a/usr/lib/pkcs11/leeds_stdll/Makefile.am
+++ b/usr/lib/pkcs11/leeds_stdll/Makefile.am
@@ -1,7 +1,9 @@
+include $(top_srcdir)/defs.am
+
 stdll_LTLIBRARIES=libpkcs11_4758.la
 
-libpkcs11_4758_la_LDFLAGS = $(SCC_LIBS) -nostartfiles -shared  \
-       -Wl,-Bsymbolic -lpthread -lscc -ldl
+libpkcs11_4758_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_4758_la_LIBADD = $(SCC_LIBS) -lpthread -lscc -ldl
 
 libpkcs11_4758_la_CFLAGS = -DDEV -D_THREAD_SAFE -DLEEDS_BUILD
 
diff --git a/usr/lib/pkcs11/soft_stdll/Makefile.am 
b/usr/lib/pkcs11/soft_stdll/Makefile.am
index c9b9587..6f241a6 100644
--- a/usr/lib/pkcs11/soft_stdll/Makefile.am
+++ b/usr/lib/pkcs11/soft_stdll/Makefile.am
@@ -1,7 +1,9 @@
+include $(top_srcdir)/defs.am
+
 stdll_LTLIBRARIES = libpkcs11_sw.la
 
-libpkcs11_sw_la_LDFLAGS = -shared -Wl,-Bsymbolic       \
-                                            -lc -lpthread -lcrypto
+libpkcs11_sw_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_sw_la_LIBADD = -lpthread -lcrypto
 
 libpkcs11_sw_la_CFLAGS = -DSPINXPL -DDEV -D_THREAD_SAFE  \
                                            -DSHALLOW=0 -DSWTOK=1 -DLITE=0  \
diff --git a/usr/lib/pkcs11/tpm_stdll/Makefile.am 
b/usr/lib/pkcs11/tpm_stdll/Makefile.am
index 2a9808c..f0fcfea 100644
--- a/usr/lib/pkcs11/tpm_stdll/Makefile.am
+++ b/usr/lib/pkcs11/tpm_stdll/Makefile.am
@@ -1,3 +1,5 @@
+include $(top_srcdir)/defs.am
+
 # Makefile.am for common functions for openCryptoki
 # Michael A. Halcrow <[email protected]>
 stdll_LTLIBRARIES=libpkcs11_tpm.la
@@ -11,8 +13,8 @@ libpkcs11_tpm_la_CFLAGS = -DLINUX -DSPINXPL -DNOCDMF  \
                                             -I../common -DMMAP         \
                                             -DSTDLL_NAME=\"tpmtok\"
 
-libpkcs11_tpm_la_LDFLAGS = -shared -Wl,-Bsymbolic      \
-                                             -lcrypto -ltspi -lpthread
+libpkcs11_tpm_la_LDFLAGS = $(TOKEN_LDFLAGS)
+libpkcs11_tpm_la_LIBADD = -lcrypto -ltspi -lpthread
 
 libpkcs11_tpm_la_SOURCES = ../common/asn1.c           \
                                             ../common/btree.c          \
-- 
1.7.5.rc1


------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to