summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2012-07-17 08:05:18 +0200
committerStef Walter <stefw@gnome.org>2012-07-26 12:22:31 +0200
commit356377709cd1de1308d9d8cf15f528578a360cf3 (patch)
tree6266878e283f1eeaf582dbe14818853793fb120f
parentf10d361a5b523ce7f9289ba8d45ccd847510d619 (diff)
downloadp11-kit-356377709cd1de1308d9d8cf15f528578a360cf3.tar.gz
Use correct shared library extension on windows
* The windows shared libraries have the .dll extension * This means we also need separate directories for the test module configs on win32 https://bugzilla.gnome.org/show_bug.cgi?id=44740
-rw-r--r--configure.ac4
-rw-r--r--p11-kit/Makefile.am14
-rw-r--r--tests/files/system-modules/win32/one.module3
-rw-r--r--tests/files/system-modules/win32/two-duplicate.module3
-rw-r--r--tests/files/system-modules/win32/two.badname5
-rw-r--r--tests/files/user-modules/win32/one.module2
-rw-r--r--tests/files/user-modules/win32/three.module5
-rw-r--r--tests/test-init.c2
8 files changed, 37 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 06fa646..b6d21d0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -270,6 +270,10 @@ AC_SUBST(GENHTML)
P11KIT_LT_RELEASE=$P11KIT_CURRENT:$P11KIT_REVISION:$P11KIT_AGE
AC_SUBST(P11KIT_LT_RELEASE)
+eval SHLEXT=$shrext_cmds
+AC_DEFINE_UNQUOTED(SHLEXT, ["$SHLEXT"], [File extension for shared libraries])
+AC_SUBST(SHLEXT)
+
AC_CONFIG_FILES([Makefile
doc/Makefile
doc/version.xml
diff --git a/p11-kit/Makefile.am b/p11-kit/Makefile.am
index cba556e..2985d85 100644
--- a/p11-kit/Makefile.am
+++ b/p11-kit/Makefile.am
@@ -59,6 +59,18 @@ libp11_kit_testable_la_LDFLAGS = \
libp11_kit_testable_la_SOURCES = $(MODULE_SRCS)
+if OS_WIN32
+
+libp11_kit_testable_la_CFLAGS = \
+ -DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/tests/files/system-pkcs11.conf"\" \
+ -DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/tests/files/system-modules/win32"\" \
+ -DP11_USER_CONFIG_FILE=\""$(abs_top_srcdir)/tests/files/user-pkcs11.conf"\" \
+ -DP11_USER_CONFIG_MODULES=\""$(abs_top_srcdir)/tests/files/user-modules/win32"\" \
+ -DP11_MODULE_PATH=\""$(abs_top_builddir)/tests/.libs"\" \
+ $(NULL)
+
+else
+
libp11_kit_testable_la_CFLAGS = \
-DP11_SYSTEM_CONFIG_FILE=\""$(abs_top_srcdir)/tests/files/system-pkcs11.conf"\" \
-DP11_SYSTEM_CONFIG_MODULES=\""$(abs_top_srcdir)/tests/files/system-modules"\" \
@@ -67,6 +79,8 @@ libp11_kit_testable_la_CFLAGS = \
-DP11_MODULE_PATH=\""$(abs_top_builddir)/tests/.libs"\" \
$(NULL)
+endif
+
libp11_kit_compat_la_SOURCES = \
debug.c debug.h \
messages.c \
diff --git a/tests/files/system-modules/win32/one.module b/tests/files/system-modules/win32/one.module
new file mode 100644
index 0000000..5f80304
--- /dev/null
+++ b/tests/files/system-modules/win32/one.module
@@ -0,0 +1,3 @@
+
+module: mock-one.dll
+setting: system1 \ No newline at end of file
diff --git a/tests/files/system-modules/win32/two-duplicate.module b/tests/files/system-modules/win32/two-duplicate.module
new file mode 100644
index 0000000..e80c9e8
--- /dev/null
+++ b/tests/files/system-modules/win32/two-duplicate.module
@@ -0,0 +1,3 @@
+
+# This is a duplicate of the 'two' module
+module: mock-two.dll
diff --git a/tests/files/system-modules/win32/two.badname b/tests/files/system-modules/win32/two.badname
new file mode 100644
index 0000000..ae44b83
--- /dev/null
+++ b/tests/files/system-modules/win32/two.badname
@@ -0,0 +1,5 @@
+# This module doesn't have a .module extension, but p11-kit doesn't yet
+# enforce the naming, just warns, so it should still be loaded
+
+module: mock-two.dll
+setting: system2
diff --git a/tests/files/user-modules/win32/one.module b/tests/files/user-modules/win32/one.module
new file mode 100644
index 0000000..c371e4a
--- /dev/null
+++ b/tests/files/user-modules/win32/one.module
@@ -0,0 +1,2 @@
+
+setting: user1 \ No newline at end of file
diff --git a/tests/files/user-modules/win32/three.module b/tests/files/user-modules/win32/three.module
new file mode 100644
index 0000000..58f883d
--- /dev/null
+++ b/tests/files/user-modules/win32/three.module
@@ -0,0 +1,5 @@
+
+module: mock-three.dll
+setting: user3
+
+enable-in: test-enable \ No newline at end of file
diff --git a/tests/test-init.c b/tests/test-init.c
index 8128db6..d872afa 100644
--- a/tests/test-init.c
+++ b/tests/test-init.c
@@ -273,7 +273,7 @@ test_load_and_initialize (CuTest *tc)
CK_RV rv;
int ret;
- rv = p11_kit_load_initialize_module (BUILDDIR "/.libs/mock-one.so", &module);
+ rv = p11_kit_load_initialize_module (BUILDDIR "/.libs/mock-one" SHLEXT, &module);
CuAssertTrue (tc, rv == CKR_OK);
CuAssertTrue (tc, module != NULL);