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 3edb062..32e916a 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 dafbc94..5480bfc 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 82d9387..33b3baa 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/dig_mgr.c       \
diff --git a/usr/lib/pkcs11/cr_stdll/Makefile.am 
b/usr/lib/pkcs11/cr_stdll/Makefile.am
index bf087f6..721ce4f 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 906cef1..41a16a5 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 558cd87..8bb77d0 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 50afc35..6f025d1 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 2927c4d..61b9eab 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           \
                                               dig_mgr.c                  \
-- 
1.7.4.rc3


------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Opencryptoki-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech

Reply via email to