summaryrefslogtreecommitdiff
path: root/p11-kit/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'p11-kit/Makefile.am')
-rw-r--r--p11-kit/Makefile.am32
1 files changed, 32 insertions, 0 deletions
diff --git a/p11-kit/Makefile.am b/p11-kit/Makefile.am
index 97e03dd..155ef3b 100644
--- a/p11-kit/Makefile.am
+++ b/p11-kit/Makefile.am
@@ -104,6 +104,7 @@ noinst_LTLIBRARIES += \
check_LTLIBRARIES += \
libp11-kit-testable.la \
+ libp11-kit-pkcs11-gnu.la \
$(NULL)
libp11_kit_internal_la_LDFLAGS = -no-undefined
@@ -117,6 +118,37 @@ libp11_kit_testable_la_SOURCES = \
$(NULL)
libp11_kit_testable_la_LIBADD = $(COMMON_LIBS)
+pkcs11_gnu_sources = \
+ p11-kit/uri.gnu.c \
+ p11-kit/iter.gnu.c \
+ p11-kit/pin.gnu.c \
+ $(NULL)
+
+BUILT_SOURCES += $(pkcs11_gnu_sources)
+CLEANFILES += $(pkcs11_gnu_sources)
+
+p11-kit/uri.gnu.c: p11-kit/uri.h
+p11-kit/iter.gnu.c: p11-kit/iter.h
+p11-kit/pin.gnu.c: p11-kit/pin.h
+
+SUFFIXES = .h .gnu.c
+.h.gnu.c:
+ $(AM_V_GEN) src=$<; dst=$@; rm -f $@-t $@ && \
+ { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+ echo; \
+ echo '#include <stdlib.h>'; \
+ echo '#include "p11-kit/p11-kit.h"'; \
+ cat $$src; \
+ echo "void *$${dst}_funcs[] = {" | sed 's/[^][ *a-z0-9_={]/_/g'; \
+ sed -n -e '/^typedef/d' -e 's/.* \(p11_kit_[^ ]*\) *(.*/ \1,/p' $<; \
+ echo '};'; \
+ } > $@-t && \
+ mv -f $@-t $@
+
+libp11_kit_pkcs11_gnu_la_LDFLAGS = -no-undefined
+libp11_kit_pkcs11_gnu_la_SOURCES = $(pkcs11_gnu_sources)
+libp11_kit_pkcs11_gnu_la_CFLAGS = -DCRYPTOKI_GNU=1 -DP11_KIT_FUTURE_UNSTABLE_API=1
+
if OS_WIN32
libp11_kit_testable_la_CFLAGS = \