[pkg-opensc-commit] [libp11] 14/51: Add files via upload
Eric Dorland
eric at moszumanska.debian.org
Wed Dec 7 17:51:30 UTC 2016
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libp11.
commit b313f00cc9bc9191b2ebab014219721eab6798a6
Author: nased0 <pw178860 at gmail.com>
Date: Sun Oct 23 22:14:59 2016 +0200
Add files via upload
---
INSTALL.md | 18 ++++++++++++++++--
examples/auth.c | 9 ++++++---
examples/decrypt.c | 11 ++++++++---
examples/listkeys.c | 2 --
src/Makefile.am | 8 +++++---
src/atfork.c | 4 ++++
6 files changed, 39 insertions(+), 13 deletions(-)
diff --git a/INSTALL.md b/INSTALL.md
index 7133685..621c1d8 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -33,9 +33,23 @@ For x64 bit builds, make sure you opened the Native x64 VS Command Prompt and ru
If any of your builds fail for any reason, ensure you clean the src directory of obj files before re-making.
-### Mingw
+### MSYS2
-TODO
+To build libp11, download and install msys2-i686-*.exe from https://msys2.github.io
+
+then start a MSYS2 MSYS console from the Start menu and use:
+
+ pacman -S git pkg-config libtool autoconf automake make gcc openssl-devel
+
+ git clone https://github.com/OpenSC/libp11.git
+
+ cd libp11
+
+ autoreconf -fi
+
+ ./configure --prefix=/usr/local
+
+ make && make install
### Cygwin
diff --git a/examples/auth.c b/examples/auth.c
index 0c11e38..f1bb21a 100644
--- a/examples/auth.c
+++ b/examples/auth.c
@@ -10,7 +10,9 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#if !defined(_WIN32) || defined(__CYGWIN__)
#include <termios.h>
+#endif
#include <stdio.h>
#include <unistd.h>
#include <string.h>
@@ -81,6 +83,7 @@ int main(int argc, char *argv[])
if (argc > 2) {
strcpy(password, argv[2]);
} else {
+#if !defined(_WIN32) || defined(__CYGWIN__)
struct termios old, new;
/* Turn echoing off and fail if we can't. */
@@ -91,15 +94,15 @@ int main(int argc, char *argv[])
new.c_lflag &= ~ECHO;
if (tcsetattr(0, TCSAFLUSH, &new) != 0)
goto failed;
-
+#endif
/* Read the password. */
printf("Password for token %.32s: ", slot->token->label);
if (fgets(password, sizeof(password), stdin) == NULL)
goto failed;
-
+#if !defined(_WIN32) || defined(__CYGWIN__)
/* Restore terminal. */
(void)tcsetattr(0, TCSAFLUSH, &old);
-
+#endif
/* strip tailing \n from password */
rc = strlen(password);
if (rc <= 0)
diff --git a/examples/decrypt.c b/examples/decrypt.c
index fe14544..4b6d248 100644
--- a/examples/decrypt.c
+++ b/examples/decrypt.c
@@ -11,7 +11,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#if !defined(_WIN32) || defined(__CYGWIN__)
#include <termios.h>
+#endif
#include <stdio.h>
#include <string.h>
#include <libp11.h>
@@ -37,8 +39,9 @@ int main(int argc, char *argv[])
unsigned int nslots, ncerts;
/* get password */
+#if !defined(_WIN32) || defined(__CYGWIN__)
struct termios old, new;
-
+#endif
if (argc != 2) {
fprintf(stderr, "usage: auth /usr/lib/opensc-pkcs11.so\n");
return 1;
@@ -155,6 +158,7 @@ int main(int argc, char *argv[])
if (!slot->token->loginRequired)
goto loggedin;
+#if !defined(_WIN32) || defined(__CYGWIN__)
/* Turn echoing off and fail if we can't. */
if (tcgetattr(0, &old) != 0)
goto failed;
@@ -163,15 +167,16 @@ int main(int argc, char *argv[])
new.c_lflag &= ~ECHO;
if (tcsetattr(0, TCSAFLUSH, &new) != 0)
goto failed;
-
+#endif
/* Read the password. */
printf("Password for token %.32s: ", slot->token->label);
if (fgets(password, sizeof(password), stdin) == NULL)
goto failed;
+#if !defined(_WIN32) || defined(__CYGWIN__)
/* Restore terminal. */
(void)tcsetattr(0, TCSAFLUSH, &old);
-
+#endif
/* strip tailing \n from password */
rc = strlen(password);
if (rc <= 0)
diff --git a/examples/listkeys.c b/examples/listkeys.c
index 5e4249b..d842ec7 100644
--- a/examples/listkeys.c
+++ b/examples/listkeys.c
@@ -10,12 +10,10 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <termios.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
-#include <sys/wait.h>
#include <libp11.h>
#include <unistd.h>
diff --git a/src/Makefile.am b/src/Makefile.am
index c39266b..ac504ec 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -21,7 +21,7 @@ dist_noinst_DATA = libp11.rc
endif
libp11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_CFLAGS)
libp11_la_LIBADD = $(OPENSSL_LIBS)
-libp11_la_LDFLAGS = $(AM_LDFLAGS) \
+libp11_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined \
-version-info @LIBP11_LT_CURRENT@:@LIBP11_LT_REVISION@:@LIBP11_LT_AGE@ \
-export-symbols "$(srcdir)/libp11.exports"
@@ -33,14 +33,16 @@ dist_noinst_DATA += pkcs11.rc
endif
pkcs11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_EXTRA_CFLAGS) $(OPENSSL_CFLAGS)
pkcs11_la_LIBADD = $(libp11_la_OBJECTS) $(OPENSSL_LIBS)
-pkcs11_la_LDFLAGS = $(AM_LDFLAGS) -module -shared -shrext $(SHARED_EXT) \
+pkcs11_la_LDFLAGS = $(AM_LDFLAGS) -module -no-undefined -shared -shrext $(SHARED_EXT) \
-avoid-version -export-symbols "$(srcdir)/pkcs11.exports"
# OpenSSL older than 1.1.0 expected libpkcs11.so instead of pkcs11.so
check-local: $(LTLIBRARIES)
cd .libs && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+
install-exec-hook:
- cd '$(DESTDIR)$(enginesdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
+ cp -pR -f .libs/pkcs11$(SHARED_EXT) $(DESTDIR)$(enginesdir)/pkcs11$(SHARED_EXT) \
+ && cd '$(DESTDIR)$(enginesdir)' && $(LN_S) -f pkcs11$(SHARED_EXT) libpkcs11$(SHARED_EXT)
if WIN32
# def file required for MS users to build library
diff --git a/src/atfork.c b/src/atfork.c
index a51835f..04691fb 100644
--- a/src/atfork.c
+++ b/src/atfork.c
@@ -20,7 +20,11 @@
*/
#include "libp11-int.h"
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <winsock2.h>
+#else
#include <sys/socket.h>
+#endif
#include <errno.h>
#include <sys/stat.h>
#include <sys/types.h>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/libp11.git
More information about the pkg-opensc-commit
mailing list