[pkg-opensc-commit] [engine-pkcs11] 55/152: New build system
Eric Dorland
eric at moszumanska.debian.org
Mon Oct 19 03:11:14 UTC 2015
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository engine-pkcs11.
commit 2b38204f22dfa9415b1dcd87614500a0fda29176
Author: Alon Bar-Lev <alon.barlev at gmail.com>
Date: Fri Apr 4 22:22:33 2008 +0000
New build system
Merge new build system, support mingw, sync with other projects.
merge -r 65:80 https://www.opensc-project.org/svn/engine_pkcs11/branches/alonbl/mingw
_M .
M configure.ac
_M doc
D doc/changelog.sh
D doc/export-wiki.xsl
M doc/Makefile.am
D doc/export-wiki.sh
AM doc/nonpersistent
A doc/nonpersistent/export-wiki.xsl
A doc/nonpersistent/Makefile.am
A doc/nonpersistent/export-wiki.sh
A doc/nonpersistent/svn2cl.xsl
D doc/svn2cl.xsl
_M src
M src/hw_pkcs11.c
M src/engine_pkcs11.c
M src/Makefile.am
A src/versioninfo.rc.in
A src/engine_pkcs11.exports
M Makefile.am
A svnignore
D aclocal
---
Makefile.am | 29 +-
aclocal/Makefile.am | 3 -
configure.ac | 476 +++++++++++++++++---------------
doc/Makefile.am | 17 +-
doc/changelog.sh | 28 --
doc/export-wiki.sh | 67 -----
doc/nonpersistent/Makefile.am | 50 ++++
doc/nonpersistent/export-wiki.sh | 70 +++++
doc/{ => nonpersistent}/export-wiki.xsl | 2 +-
doc/{ => nonpersistent}/svn2cl.xsl | 0
src/Makefile.am | 41 ++-
src/engine_pkcs11.c | 29 ++
src/engine_pkcs11.exports | 2 +
src/hw_pkcs11.c | 1 +
src/versioninfo.rc.in | 35 +++
svnignore | 55 ++++
16 files changed, 556 insertions(+), 349 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 5d178d6..9cc4b04 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,17 +1,20 @@
-# Process this file with automake to create Makefile.in
-
-SUBDIRS = . aclocal src
-DIST_SUBDIRS = . aclocal doc src
-
-EXTRA_DIST = NEWS bootstrap depcomp
+AUTOMAKE_OPTIONS = foreign 1.10
MAINTAINERCLEANFILES = \
- Makefile.in config.h.in configure \
- install-sh ltmain.sh missing mkinstalldirs \
- compile depcomp config.log config.status \
- config.guess config.sub acinclude.m4 aclocal.m4
+ config.log config.status \
+ $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \
+ $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \
+ $(srcdir)/depcomp $(srcdir)/aclocal.m4 \
+ $(srcdir)/config.guess $(srcdir)/config.sub \
+ $(srcdir)/packaged
+EXTRA_DIST = svnignore
+
+SUBDIRS = src doc
-DEPCLEANFILES = config.log configure
+dist_noinst_SCRIPTS = bootstrap
+dist_doc_DATA = NEWS
-AUTOMAKE_OPTIONS = foreign 1.5
-ACLOCAL_AMFLAGS = -I aclocal
+# Allow detection of packaged tarball
+dist-hook:
+ echo > "$(distdir)/packaged"
diff --git a/aclocal/Makefile.am b/aclocal/Makefile.am
deleted file mode 100644
index e44e49c..0000000
--- a/aclocal/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-# Process this file with automake to create Makefile.in
-
-MAINTAINERCLEANFILES = Makefile.in
diff --git a/configure.ac b/configure.ac
index 1f44014..5a21657 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,231 +1,226 @@
-dnl -*- mode: m4; -*-
-dnl Process this file with autoconf to produce a configure script.
-# Require autoconf 2.52
-AC_PREREQ(2.52)
+AC_PREREQ([2.60])
-AC_INIT(engine_pkcs11, [0.1.4-svn])
+define([PACKAGE_VERSION_MAJOR], [0])
+define([PACKAGE_VERSION_MINOR], [1])
+define([PACKAGE_VERSION_FIX], [4])
-AM_INIT_AUTOMAKE
-AM_CONFIG_HEADER(config.h)
+AC_INIT([engine_pkcs11], [PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX-svn])
+AC_CONFIG_AUX_DIR([.])
+AM_CONFIG_HEADER([config.h])
+AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
-AC_CONFIG_SRCDIR(src/engine_pkcs11.c)
+ENGINE_PKCS11_VERSION_MAJOR="PACKAGE_VERSION_MAJOR"
+ENGINE_PKCS11_VERSION_MINOR="PACKAGE_VERSION_MINOR"
+ENGINE_PKCS11_VERSION_FIX="PACKAGE_VERSION_FIX"
+AC_CONFIG_SRCDIR(src/engine_pkcs11.c)
AC_CANONICAL_HOST
AC_PROG_CC
+PKG_PROG_PKG_CONFIG
AC_C_BIGENDIAN
-dnl Options
-AM_MAINTAINER_MODE
+AC_MSG_CHECKING([svn checkout])
+if test -e packaged; then
+ svn_checkout="no"
+else
+ svn_checkout="yes"
+fi
+AC_MSG_RESULT([${svn_checkout}])
+
+AC_ARG_WITH(
+ [cygwin-native],
+ [AC_HELP_STRING([--with-cygwin-native], [compile native win32])],
+ ,
+ [with_cygwin_native="no"]
+)
+
+dnl Check for some target-specific stuff
+test -z "${WIN32}" && WIN32="no"
+test -z "${CYGWIN}" && CYGWIN="no"
+case "${host}" in
+ *-mingw32*|*-winnt*)
+ WIN32="yes"
+ CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN"
+ WIN_LIBPREFIX="lib"
+ ;;
+ *-cygwin*)
+ AC_MSG_CHECKING([cygwin mode to use])
+ CYGWIN="yes"
+ if test "${with_cygwin_native}" = "yes"; then
+ AC_MSG_RESULT([Using native win32])
+ CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN"
+ CFLAGS="${CFLAGS} -mno-cygwin"
+ WIN32="yes"
+ else
+ AC_MSG_RESULT([Using cygwin])
+ CPPFLAGS="${CPPFLAGS} -DCRYPTOKI_FORCE_WIN32"
+ WIN_LIBPREFIX="cyg"
+ AC_DEFINE([USE_CYGWIN], [1], [Define if you are on Cygwin])
+ fi
+ ;;
+esac
+
+AC_ARG_ENABLE(
+ [strict],
+ [AC_HELP_STRING([--enable-strict], [enable strict compile mode @<:@disabled@:>@])],
+ ,
+ [enable_strict="no"]
+)
+
+AC_ARG_ENABLE(
+ [pedantic],
+ [AC_HELP_STRING([--enable-pedantic], [enable pedantic compile mode @<:@disabled@:>@])],
+ ,
+ [enable_pedantic="no"]
+)
+
+AC_ARG_ENABLE(
+ [doc],
+ [AC_HELP_STRING([--enable-doc], [enable installation of documents. @<:@disabled@:>@])],
+ ,
+ [enable_doc="no"]
+)
+
+AC_ARG_WITH(
+ [enginesdir],
+ [AC_HELP_STRING([--with-enginesdir], [OpenSSL engines directory. @<:@/usr/lib/engines@:>@])],
+ [enginesdir="${withval}"],
+ [enginesdir="\$(libdir)/engines"]
+)
dnl Checks for programs.
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
+AC_PROG_MKDIR_P
+AC_PROG_SED
AC_PROG_MAKE_SET
dnl Add libtool support.
-AM_PROG_LIBTOOL
-dnl Automatically update the libtool script if it becomes out-of-date.
-#AC_SUBST(LIBTOOL_DEPS)
+AC_LIBTOOL_WIN32_DLL
+AC_LIBTOOL_RC
+AC_PROG_LIBTOOL
dnl Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([errno.h fcntl.h malloc.h stdlib.h inttypes.h string.h strings.h sys/time.h unistd.h locale.h getopt.h dlfcn.h utmp.h])
-
-PKG_CHECK_MODULES([LIBP11], [libp11 >= 0.2.1])
-
-dnl The big mess with OpenSSL
-saved_LIBS="$LIBS"
-saved_LDFLAGS="$LDFLAGS"
-saved_CPPFLAGS="$CPPFLAGS"
-
-SSL_MSG="no"
-ssldir=""
-
-AC_ARG_WITH(openssl,
- AC_HELP_STRING([--with-openssl=PATH], [use OpenSSL in PATH]),
- [
- # Disable OpenSSL support
- if test "x$withval" = "xno" ; then
- SSL_MSG="no (disabled)"
- break;
- fi
+AC_CHECK_HEADERS([ \
+ errno.h fcntl.h malloc.h stdlib.h inttypes.h \
+ string.h strings.h sys/time.h unistd.h \
+ locale.h getopt.h dlfcn.h utmp.h \
+])
- # ok we got a directory, so only check in that dir.
- LIBCRYPTO="-lcrypto"
- CPPFLAGS="$saved_CPPFLAGS"
- LDFLAGS="$saved_LDFLAGS"
- LIBS="$LIBCRYPTO $saved_LIBS"
- LDFLAGS="-L$withval/lib $saved_LDFLAGS"
- if test ! -z "$need_dash_r" ; then
- LDFLAGS="-R$withval/lib $LDFLAGS"
- fi
- CPPFLAGS="-I$withval/include $saved_CPPFLAGS"
-
- AC_TRY_RUN(
- [
-#include <string.h>
-#include <openssl/rand.h>
-int main(void)
-{
- char a[2048];
- memset(a, 0, sizeof(a));
- RAND_add(a, sizeof(a), sizeof(a));
- return(RAND_status() <= 0);
-}
- ],
- [
- SSL_MSG="yes"
- ssldir="$withval"
- break
- ])
- ],[
-
- # we didn't get a directory, so we start searching for openssl
- for tryssldir in $commondir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl; do
- # Skip directories if they don't exist
- if test ! -d "$tryssldir/" ; then
- continue;
+PKG_CHECK_MODULES([LIBP11], [libp11 >= 0.2.1],, [AC_MSG_ERROR([libp11 is required])])
+
+dnl These required for svn checkout
+AC_ARG_VAR([XSLTPROC], [xsltproc utility])
+AC_ARG_VAR([SVN], [subversion utility])
+AC_ARG_VAR([WGET], [wget utility])
+AC_ARG_VAR([WGET_OPTS], [wget options])
+AC_ARG_VAR([TR], [tr utility])
+AC_CHECK_PROGS([XSLTPROC],[xsltproc])
+AC_CHECK_PROGS([SVN],[svn])
+AC_CHECK_PROGS([WGET],[wget])
+AC_CHECK_PROGS([TR],[tr])
+test -z "${WGET_OPTS}" && WGET_OPTS="-nv"
+
+dnl svn checkout dependencies
+if test "${svn_checkout}" = "yes"; then
+ AC_MSG_CHECKING([XSLTPROC requirement])
+ if test -n "${XSLTPROC}"; then
+ AC_MSG_RESULT([ok])
+ else
+ if test "${enable_doc}" = "yes"; then
+ AC_MSG_ERROR([Missing XSLTPROC svn build with doc])
+ else
+ AC_MSG_WARN(["make dist" will not work])
fi
+ fi
- LIBCRYPTO="-lcrypto"
- CPPFLAGS="$saved_CPPFLAGS"
- LDFLAGS="$saved_LDFLAGS"
- LIBS="$saved_LIBS $LIBCRYPTO"
-
- if test "x$tryssldir" != "x/usr"; then
- LDFLAGS="-L$tryssldir/lib $saved_LDFLAGS"
- if test ! -z "$need_dash_r" ; then
- LDFLAGS="-R$tryssldir/lib $LDFLAGS"
- fi
- CPPFLAGS="-I$tryssldir/include $saved_CPPFLAGS"
+ AC_MSG_CHECKING([svn doc build dependencies])
+ if test -n "${SVN}" -a -n "${TR}" -a -n "${WGET}"; then
+ AC_MSG_RESULT([ok])
+ else
+ if test "${enable_doc}" = "yes"; then
+ AC_MSG_ERROR([Missing SVN, TR or WGET for svn doc build])
+ else
+ AC_MSG_WARN(["make dist" will not work])
fi
-
- # Basic test to check for compatible version and correct linking
- # *does not* test for RSA - that comes later.
- AC_TRY_RUN(
- [
-#include <string.h>
-#include <openssl/rand.h>
-int main(void)
-{
- char a[2048];
- memset(a, 0, sizeof(a));
- RAND_add(a, sizeof(a), sizeof(a));
- return(RAND_status() <= 0);
-}
- ],
- [
- SSL_MSG="yes"
- ssldir=$tryssldir
- break;
- ],
- [
- SSL_MSG="no"
- LIBS="$saved_LIBS"
- LDFLAGS="$saved_LDFLAGS"
- CPPFLAGS="$saved_CPPFLAGS"
- ])
- done
- ])
-LIBS="$saved_LIBS"
-AC_SUBST(LIBCRYPTO)
-AM_CONDITIONAL(HAVE_SSL, test "x$SSL_MSG" = "xyes")
-
-if test "x$SSL_MSG" = "xyes" ; then
- AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries])
-else
- LIBCRYPTO=""
+ fi
fi
-# ok, we checked for basic ssl support.
-# if it is not available, we can skip the rest of
-# the test. also we have $ssldir set to the location
-# of the openssl libs.
-
-ENGINE_MSG="no"
-if test "x$SSL_MSG" = "xyes"; then
- # engine has to be there and working
- LIBS="$saved_LIBS $LIBCRYPTO $LIBDL"
- AC_TRY_RUN(
- [
-#include <string.h>
-#include <openssl/opensslv.h>
-#include <openssl/engine.h>
-#include <openssl/rand.h>
-int main(void)
-{
- char a[2048];
- ENGINE *e;
-
- e = ENGINE_new();
- ENGINE_load_dynamic();
- if (!e) return 1;
- memset(a, 0, sizeof(a));
- RAND_add(a, sizeof(a), sizeof(a));
- return(RAND_status() <= 0);
-}
- ],
- [
- ENGINE_MSG=yes
- ENGINE_LINK="$LIBCRYPTO"
- ],
- [
- ENGINE_MSG=no
- ])
-fi
-LIBS="$saved_LIBS"
-AC_SUBST(ENGINE_LINK)
-AM_CONDITIONAL(HAVE_ENGINE, test "x$ENGINE_MSG" = "xyes")
+PKG_CHECK_MODULES(
+ [OPENSSL],
+ [libcrypto >= 0.9.7],
+ ,
+ [PKG_CHECK_MODULES(
+ [OPENSSL],
+ [openssl >= 0.9.7],
+ ,
+ [AC_CHECK_LIB(
+ [crypto],
+ [RSA_version],
+ [OPENSSL_LIBS="-lcrypto"],
+ [AC_MSG_ERROR([Cannot find OpenSSL])]
+ )]
+ )]
+)
# ok, now we might (or not) have ssl and an engine.
# still room for "improvements", i.e. hacks to work
# with old engines.
-SSLHACK_MSG=no
-if test "x$SSL_MSG" = "xyes" -a "x$ENGINE_MSG" = "xyes"; then
- # latest openssl version with engine
- # properly integrated?
- AC_MSG_CHECKING([for openssl version])
- AC_TRY_RUN(
+AC_MSG_CHECKING([for openssl version])
+saved_CPPFLAGS="${CPPFLAGS}"
+CPPFLAGS="${CPPFLAGS} ${OPENSSL_CFLAGS}"
+AC_EGREP_CPP(
+ [new],
[
-#include <stdlib.h>
-#include <string.h>
#include <openssl/opensslv.h>
-
-int main(void)
-{
- if(OPENSSL_VERSION_NUMBER >= 0x0090704fL) {
- exit(0);
- } else {
- exit(1);
- }
-}
+#if OPENSSL_VERSION_NUMBER >= 0x0090704fL
+new
+#else
+old
+#endif
],
[
AC_MSG_RESULT([good, 0.9.7d or later])
- OLD_OPENSSL=no
+ old_openssl="no"
],
[
AC_MSG_RESULT([not so good, 0.9.7d or later would be better])
- OLD_OPENSSL=yes
- ])
-
- if test "x$OLD_OPENSSL" = "xyes"; then
- # openssl found, but version less than 0.9.7d
- # linking libcrypto.a statically possible?
-
- LIBS="$saved_LIBS $ssldir/lib/libcrypto.a $LIBDL"
- AC_TRY_RUN(
- [
+ old_openssl="yes"
+ ]
+)
+CPPFLAGS="${saved_CPPFLAGS}"
+
+if test "x$old_openssl" = "xyes"; then
+ # openssl found, but version less than 0.9.7d
+ # linking libcrypto.a statically possible?
+
+ saved_CFLAGS="${CFLAGS}"
+ saved_LIBS="${LIBS}"
+ CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
+ if echo "${OPENSSL_LIBS}" | grep -- "-L" > /dev/null; then
+ OPENSSL_DIR="$(echo "${OPENSSL_LIBS}" | ${SED} 's/.*-L\([^ ]*\).*/\1/')"
+ else
+ OPENSSL_DIR="${usrlibdir}"
+ fi
+ LIBS="${LIBS} ${OPENSSL_DIR}/libcrypto.a"
+ AC_CHECK_LIB(
+ [dl],
+ [dlopen]
+ )
+ AC_MSG_CHECKING([should link static openssl])
+ AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM([[
#include <string.h>
#include <openssl/opensslv.h>
#include <openssl/engine.h>
#include <openssl/rand.h>
-int main(void)
+int test(void)
{
char a[2048];
ENGINE *e;
@@ -237,46 +232,97 @@ int main(void)
RAND_add(a, sizeof(a), sizeof(a));
return(RAND_status() <= 0);
}
- ],
+ ]])],
[
- SSLHACK_MSG=yes
- ENGINE_LINK="$ssldir/lib/libcrypto.a"
- ])
- LIBS="$saved_LIBS"
- fi
+ AC_MSG_RESULT([yes])
+ ENGINE_LINK="${OPENSSL_DIR}/libcrypto.a"
+ ],
+ [AC_MSG_ERROR([OpenSSL is old and cannot link with its static library])]
+ )
+ CFLAGS="${saved_CFLAGS}"
+ LIBS="${saved_LIBS}"
fi
+#@alonbl: This was never actually used.
+#
# now - last part to do: check if we gain anything from
# funny parameters to link openssl with.
-
-saved_LDFLAGS="$LDFLAGS"
-if test "x$ENGINE_MSG" = "xyes" ; then
- for openssl_ldflag in "-Wl,-Bsymbolic" "-G -Wl,-Bsymbolic" "-shared -G -Wl,-Bsymbolic" "-Wl,-all_load"; do
- AC_MSG_CHECKING([whether we can use $openssl_ldflag])
- LDFLAGS="$saved_LDFLAGS $openssl_ldflag"
- AC_TRY_LINK(,[return 1],ac_cv_use_openssl_flag="yes",ac_cv_use_openssl_flag="no")
- AC_MSG_RESULT($ac_cv_use_openssl_flag)
- if test "$ac_cv_use_openssl_flag" = "yes"; then
- OPENSSL_LDFLAGS="$openssl_ldflag"
- break;
- fi
- done
+#saved_LDFLAGS="${LDFLAGS}"
+#for test_flags in "-Wl,-Bsymbolic" "-G -Wl,-Bsymbolic" "-Wl,-all_load"; do
+# AC_MSG_CHECKING([whether we can use ${test_flags}])
+# LDFLAGS="${saved_LDFLAGS} ${test_flags}"
+# AC_LINK_IFELSE(
+# [AC_LANG_PROGRAM([[
+#int test()
+#{
+# return 1;
+#}
+# ]])],
+# [result="yes"],
+# [result="no"]
+# )
+# AC_MSG_RESULT([${result}])
+# if test "${result}" = "yes"; then
+# OPENSSL_EXTRA_LDFLAGS="${test_flags}"
+# break;
+# fi
+#done
+#LDFLAGS="${saved_LDFLAGS}"
+
+
+AC_SUBST([enginesdir])
+AC_SUBST([ENGINE_LINK])
+AC_SUBST([ENGINE_PKCS11_VERSION_MAJOR])
+AC_SUBST([ENGINE_PKCS11_VERSION_MINOR])
+AC_SUBST([ENGINE_PKCS11_VERSION_FIX])
+AC_SUBST([WIN_LIBPREFIX])
+AC_SUBST([OPENSSL_EXTRA_LDFLAGS])
+
+AM_CONDITIONAL([SVN_CHECKOUT], [test "${svn_checkout}" = "yes"])
+AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"])
+AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"])
+AM_CONDITIONAL([ENABLE_DOC], [test "${enable_doc}" = "yes"])
+
+if test "${enable_pedantic}" = "yes"; then
+ enable_strict="yes";
+ CFLAGS="${CFLAGS} -pedantic"
+fi
+if test "${enable_strict}" = "yes"; then
+ CFLAGS="${CFLAGS} -Wall -Wextra"
fi
-LDFLAGS="$saved_LDFLAGS"
-AC_SUBST(OPENSSL_LDFLAGS)
AC_OUTPUT([
-Makefile
-aclocal/Makefile
-doc/Makefile
-src/Makefile
+ Makefile
+ doc/Makefile
+ doc/nonpersistent/Makefile
+ src/Makefile
+ src/versioninfo.rc
])
-echo ""
-echo "Engine_pkcs11 has been configured with the following options"
+cat <<EOF
+
+engine_pkcs11 has been configured with the following options:
+
+
+Version: ${PACKAGE_VERSION}
+Libraries: $(eval eval eval echo "${libdir}")
+
+doc support: ${enable_doc}
+
+Host: ${host}
+Compiler: ${CC}
+Preprocessor flags: ${CPPFLAGS}
+Compiler flags: ${CFLAGS}
+Linker flags: ${LDFLAGS}
+Libraries: ${LIBS}
+
+enginesdir ${enginesdir}
+
+LIBP11_CFLAGS: ${LIBP11_CFLAGS}
+LIBP11_LIBS: ${LIBP11_LIBS}
+OPENSSL_CFLAGS: ${OPENSSL_CFLAGS}
+OPENSSL_LIBS: ${OPENSSL_LIBS}
+OPENSSL_EXTRA_LDFLAGS: ${OPENSSL_EXTRA_LDFLAGS}
+ENGINE_LINK: ${ENGINE_LINK}
-echo ""
-echo "OpenSSL support: ${SSL_MSG}"
-echo " with engine: ${ENGINE_MSG}"
-echo " with sslhack: ${SSLHACK_MSG}"
-echo ""
+EOF
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8c2b9f8..a97911d 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,13 +1,8 @@
-# Process this file with automake to create Makefile.in
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
-MAINTAINERCLEANFILES = Makefile.in $(HTML) ChangeLog
+if ENABLE_DOC
+SUBDIRS = nonpersistent
+endif
+DIST_SUBDIRS = nonpersistent
-EXTRA_DIST = README export-wiki.sh export-wiki.xsl $(HTML) index.html ChangeLog
-
-HTML= $(shell ls $(srcdir)/*.html $(srcdir)/*.css)
-
-index.html:
- sh $(srcdir)/export-wiki.sh $(srcdir)
-
-ChangeLog:
- sh $(srcdir)/changelog.sh $(srcdir)
+dist_doc_DATA = README
diff --git a/doc/changelog.sh b/doc/changelog.sh
deleted file mode 100644
index 5a4e538..0000000
--- a/doc/changelog.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# based on svn2cl.sh # Copyright (C) 2005 Arthur de Jong.
-
-set -e
-
-SRCDIR=.
-
-if test -n "$1"
-then
- SRCDIR="$1"
-fi
-
-test -f "$SRCDIR"/`basename $0`
-
-if ! test -w "$SRCDIR"
-then
- exit 0
-fi
-
-rm -rf "$SRCDIR"/ChangeLog
-cd "$SRCDIR"/..
-
-svn --verbose --xml log | \
- xsltproc --nonet --stringparam linelen 75 \
- --stringparam groupbyday no \
- --stringparam include-rev no \
- doc/svn2cl.xsl - > doc/ChangeLog
diff --git a/doc/export-wiki.sh b/doc/export-wiki.sh
deleted file mode 100644
index 303e1e2..0000000
--- a/doc/export-wiki.sh
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/bash
-
-set -e
-
-export SERVER=http://www.opensc-project.org
-export PROJECT=engine_pkcs11
-export WIKI=$PROJECT/wiki
-export XSL=export-wiki.xsl
-
-SRCDIR=.
-
-if test -n "$1"
-then
- SRCDIR="$1"
-fi
-
-test -f "$SRCDIR"/`basename $0`
-
-if ! test -w "$SRCDIR"
-then
- exit 0
-fi
-
-rm -rf "$SRCDIR"/*.html "$SRCDIR"/*.css
-
-wget -nv $SERVER/$WIKI/TitleIndex -O "$SRCDIR"/TitleIndex.tmp
-
-sed -e "s#</li>#</li>\n#g" < "$SRCDIR"/TitleIndex.tmp \
- | grep "\"/$WIKI/[^\"]*\"" \
- |sed -e "s#.*\"/$WIKI/\([^\"]*\)\".*#\1#g" \
- > "$SRCDIR"/WikiWords.tmp
-sed -e /^Trac/d -e /^Wiki/d -e /^TitleIndex/d -e /^RecentChanges/d \
- -e /^CamelCase/d -e /^SandBox/d -i "$SRCDIR"/WikiWords.tmp
-
-for A in WikiStart `cat "$SRCDIR"/WikiWords.tmp`
-do
- F=`echo $A|sed -e 's/\//_/g'`
- wget -nv $SERVER/$WIKI/$A -O "$SRCDIR"/$F.tmp
- xsltproc --nonet --output "$SRCDIR"/$F.html "$SRCDIR"/$XSL "$SRCDIR"/$F.tmp
- sed -e "s#<a href=\"/$WIKI/\([^\"]*\)\"#<a href=\"\1.html\"#g" \
- -i "$SRCDIR"/$F.html
-done
-
-mv "$SRCDIR"/WikiStart.html "$SRCDIR"/index.html
-
-wget -nv http://www.opensc-project.org/trac/css/trac.css \
- -O "$SRCDIR"/trac.css
-
-cat *.html |grep "<img src=\"/$PROJECT/attachment/wiki" \
- |sed -e 's/.*<img src="\/'$PROJECT'\/attachment\/wiki\/\([^"]*\)?format=raw".*/\1/g' \
- |sort -u |while read A
-do
- B="`echo $A |tr / _`"
- wget -nv "$SERVER/$PROJECT/attachment/wiki/$A?format=raw" -O $B
- for C in *.html
- do
- sed -e 's#\/'$PROJECT'\/attachment\/wiki\/'$A'?format=raw#'$B'#g' -i $C
- done
-done
-
-for A in *.html
-do
- sed -e 's#href="/'$PROJECT'/wiki/\([^"]*\)"#href="\1.html"#g' \
- -i $A
-done
-
-rm "$SRCDIR"/*.tmp
diff --git a/doc/nonpersistent/Makefile.am b/doc/nonpersistent/Makefile.am
new file mode 100644
index 0000000..e4e0185
--- /dev/null
+++ b/doc/nonpersistent/Makefile.am
@@ -0,0 +1,50 @@
+MAINTAINERCLEANFILES = \
+ $(srcdir)/Makefile.in $(srcdir)/ChangeLog
+DISTCLEANFILES = \
+ ChangeLog ChangeLog.tmp
+
+wikidir=$(htmldir)/wiki
+
+dist_noinst_SCRIPTS = export-wiki.sh export-wiki.xsl \
+ svn2cl.xsl
+dist_wiki_DATA = wiki.out/*
+dist_noinst_DATA = ChangeLog
+
+if SVN_CHECKOUT
+
+wiki.out/*:
+ test -n "$(WGET)" -a -n "$(SED)" -a -n "$(TR)" -a -n "$(XSLTPROC)"
+ WGET="$(WGET)" WGET_OPTS="$(WGET_OPTS)" SED="$(SED)" TR="$(TR)" XSLTPROC="$(XSLTPROC)" \
+ PROJECT="@PACKAGE_NAME@" \
+ $(SHELL) "$(srcdir)/export-wiki.sh" "$(srcdir)" "wiki.tmp"
+ mv wiki.tmp wiki.out
+
+ChangeLog:
+ test -n "$(SVN)" -a -n "$(XSLTPROC)"
+ if test -d "$(top_srcdir)/.svn"; then \
+ $(SVN) --verbose --xml log "$(top_srcdir)" | \
+ $(XSLTPROC) --nonet --stringparam linelen 75 \
+ --stringparam groupbyday no \
+ --stringparam include-rev no \
+ "$(srcdir)/svn2cl.xsl" - > ChangeLog.tmp; \
+ else \
+ echo "Warning: Unable to generate ChangeLog from none svn checkout" >&2; \
+ echo > ChangeLog.tmp; \
+ fi
+ mv ChangeLog.tmp ChangeLog
+
+else
+
+wiki.out/*:
+ $(LN_S) "$(srcdir)/wiki.out" wiki.out
+
+ChangeLog:
+ $(LN_S) "$(srcdir)/ChangeLog" ChangeLog
+
+endif
+
+distclean-local:
+ -rm -rf wiki.out wiki.tmp
+
+maintainer-clean-local:
+ -rm -rf "$(srcdir)/wiki.out"
diff --git a/doc/nonpersistent/export-wiki.sh b/doc/nonpersistent/export-wiki.sh
new file mode 100755
index 0000000..afe5bab
--- /dev/null
+++ b/doc/nonpersistent/export-wiki.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+
+set -e
+
+test -z "$XSLTPROC" && XSLTPROC="xsltproc"
+test -z "$WGET" && WGET="wget"
+test -z "$WGET_OPTS" && WGET_OPTS="$WGET_OPTS"
+test -z "$SED" && SED="sed"
+test -z "$TR" && TR="tr"
+
+test -z "$SERVER" && SERVER="http://www.opensc-project.org"
+test -z "$PROJECT" && PROJECT="opensc"
+
+SRCDIR=.
+OUTDIR=.
+test -n "$1" && SRCDIR="$1"
+test -n "$2" && OUTDIR="$2"
+
+WIKI="$PROJECT/wiki"
+XSL="$SRCDIR/export-wiki.xsl"
+
+test -f "$SRCDIR"/`basename $0`
+
+test -e "$OUTDIR" && rm -fr "$OUTDIR"
+
+mkdir "$OUTDIR" || exit 1
+
+$WGET $WGET_OPTS $SERVER/$WIKI/TitleIndex -O "$OUTDIR"/TitleIndex.tmp
+
+$SED -e "s#</li>#</li>\n#g" < "$OUTDIR"/TitleIndex.tmp \
+ | grep "\"/$WIKI/[^\"]*\"" \
+ |$SED -e "s#.*\"/$WIKI/\([^\"]*\)\".*#\1#g" \
+ > "$OUTDIR"/WikiWords.tmp
+$SED -e /^Trac/d -e /^Wiki/d -e /^TitleIndex/d -e /^RecentChanges/d \
+ -e /^CamelCase/d -e /^SandBox/d -i "$OUTDIR"/WikiWords.tmp
+
+for A in WikiStart `cat "$OUTDIR"/WikiWords.tmp`
+do
+ F=`echo $A|$SED -e 's/\//_/g'`
+ $WGET $WGET_OPTS $SERVER/$WIKI/$A -O "$OUTDIR"/$F.tmp
+ $XSLTPROC --nonet --output "$OUTDIR"/$F.html "$XSL" "$OUTDIR"/$F.tmp
+ $SED -e "s#<a href=\"/$WIKI/\([^\"]*\)\"#<a href=\"\1.html\"#g" \
+ -i "$OUTDIR"/$F.html
+done
+
+mv "$OUTDIR"/WikiStart.html "$OUTDIR"/index.html
+
+$WGET $WGET_OPTS http://www.opensc-project.org/trac/css/trac.css \
+ -O "$OUTDIR"/trac.css
+
+cat "$OUTDIR"/*.html |grep "<img src=\"/$PROJECT/attachment/wiki" \
+ |$SED -e 's/.*<img src="\/'$PROJECT'\/attachment\/wiki\/\([^"]*\)?format=raw".*/\1/g' \
+ |sort -u |while read A
+do
+ B="`echo $A |$TR / _`"
+ $WGET $WGET_OPTS "$SERVER/$PROJECT/attachment/wiki/$A?format=raw" -O "$OUTDIR"/$B
+ for C in "${OUTDIR}"/*.html
+ do
+ $SED -e 's#\/'$PROJECT'\/attachment\/wiki\/'$A'?format=raw#'$B'#g' -i "$C"
+ done
+done
+
+for A in "${OUTDIR}"/*.html
+do
+ $SED -e 's#href="/'$PROJECT'/wiki/\([^"]*\)"#href="\1.html"#g' \
+ -i $A
+done
+
+rm "$OUTDIR"/*.tmp
+exit 0
diff --git a/doc/export-wiki.xsl b/doc/nonpersistent/export-wiki.xsl
similarity index 95%
rename from doc/export-wiki.xsl
rename to doc/nonpersistent/export-wiki.xsl
index 145befb..30a600e 100644
--- a/doc/export-wiki.xsl
+++ b/doc/nonpersistent/export-wiki.xsl
@@ -18,7 +18,7 @@ xmlns:html="http://www.w3.org/1999/xhtml">
</style>
</head>
<body>
- <xsl:apply-templates select="//html:div[@class='wikipage']" />
+ <xsl:apply-templates select="//html:div[@class='wiki']" />
<div class="footer">
<hr />
<p><a href="index.html">Back to Index</a></p>
diff --git a/doc/svn2cl.xsl b/doc/nonpersistent/svn2cl.xsl
old mode 100644
new mode 100755
similarity index 100%
rename from doc/svn2cl.xsl
rename to doc/nonpersistent/svn2cl.xsl
diff --git a/src/Makefile.am b/src/Makefile.am
index f6e4460..6543587 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,20 +1,39 @@
-# Process this file with automake to create Makefile.in
-
-enginedir = $(libdir)/engines
-
-MAINTAINERCLEANFILES = Makefile.in
-
+MAINTAINERCLEANFILES = $(srcdir)/Makefile.in
EXTRA_DIST = Makefile.mak engine_pkcs11.def
-engine_LTLIBRARIES = engine_pkcs11.la
+engines_LTLIBRARIES = engine_pkcs11.la
-OPENSSL_CFLAGS = \
+OPENSSL_EXTRA_CFLAGS = \
-DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H \
-DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO -DENGINE_DYNAMIC_SUPPORT \
-DSHA1_ASM -DMD5_ASM -DRMD160_ASM
engine_pkcs11_la_SOURCES = \
- hw_pkcs11.c engine_pkcs11.c engine_pkcs11.h
-engine_pkcs11_la_CFLAGS = $(OPENSSL_CFLAGS) $(LIBP11_CFLAGS) -I$(srcdir)/../libp11
+ hw_pkcs11.c engine_pkcs11.c engine_pkcs11.h \
+ engine_pkcs11.exports
+if WIN32
+nodist_engine_pkcs11_la_SOURCES = versioninfo.rc
+endif
+engine_pkcs11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_EXTRA_CFLAGS) $(OPENSSL_CFLAGS) \
+ $(LIBP11_CFLAGS)
engine_pkcs11_la_LIBADD = $(ENGINE_LINK) $(OPENSSL_LIBS) $(LIBP11_LIBS)
-engine_pkcs11_la_LDFLAGS = -module -avoid-version
+engine_pkcs11_la_LDFLAGS = $(AM_LDFLAGS) $(OPENSSL_EXTRA_LDFLAGS) \
+ -module -avoid-version \
+ -export-symbols "$(srcdir)/engine_pkcs11.exports" \
+ -no-undefined
+
+install-data-hook:
+ rm -f "$(DESTDIR)$(enginesdir)/engine_pkcs11.la"
+ rm -f "$(DESTDIR)$(enginesdir)/engine_pkcs11.a"
+ rm -f "$(DESTDIR)$(enginesdir)/engine_pkcs11.dll.a"
+
+RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS)
+LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE)
+
+.rc.lo:
+ $(LTRCCOMPILE) -i "$<" -o "$@"
+
+.rc.o:
+ $(RCCOMPILE) -i "$<" -o "$@"
+
diff --git a/src/engine_pkcs11.c b/src/engine_pkcs11.c
index 0429eb9..35d087a 100644
--- a/src/engine_pkcs11.c
+++ b/src/engine_pkcs11.c
@@ -25,6 +25,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <config.h>
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
@@ -64,6 +65,34 @@ int set_module(const char *modulename)
return 1;
}
+/**
+ * Set the PIN used for login. A copy of the PIN shall be made.
+ *
+ * If the PIN cannot be assigned, the value 0 shall be returned
+ * and errno shall be set as follows:
+ *
+ * EINVAL - a NULL PIN was supplied
+ * ENOMEM - insufficient memory to copy the PIN
+ *
+ * @param _pin the pin to use for login. Must not be NULL.
+ *
+ * @return 1 on success, 0 on failure.
+ */
+int set_pin(const char *_pin)
+{
+ /* Pre-condition check */
+ if (_pin == NULL) {
+ errno = EINVAL;
+ return 0;
+ }
+
+ /* Copy the PIN. If the string cannot be copied, NULL
+ shall be returned and errno shall be set. */
+ pin = strdup(_pin);
+
+ return (pin != NULL);
+}
+
int inc_verbose(void)
{
verbose++;
diff --git a/src/engine_pkcs11.exports b/src/engine_pkcs11.exports
new file mode 100644
index 0000000..6b8b3a9
--- /dev/null
+++ b/src/engine_pkcs11.exports
@@ -0,0 +1,2 @@
+v_check
+bind_engine
diff --git a/src/hw_pkcs11.c b/src/hw_pkcs11.c
index a06c6b9..74bd4ea 100644
--- a/src/hw_pkcs11.c
+++ b/src/hw_pkcs11.c
@@ -59,6 +59,7 @@
*
*/
+#include <config.h>
#include <stdio.h>
#include <string.h>
#include <openssl/crypto.h>
diff --git a/src/versioninfo.rc.in b/src/versioninfo.rc.in
new file mode 100644
index 0000000..94f66e8
--- /dev/null
+++ b/src/versioninfo.rc.in
@@ -0,0 +1,35 @@
+#include <afxres.h>
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION @ENGINE_PKCS11_VERSION_MAJOR@, at ENGINE_PKCS11_VERSION_MINOR@, at ENGINE_PKCS11_VERSION_FIX@,0
+ PRODUCTVERSION @ENGINE_PKCS11_VERSION_MAJOR@, at ENGINE_PKCS11_VERSION_MINOR@, at ENGINE_PKCS11_VERSION_FIX@,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x21L
+#else
+ FILEFLAGS 0x20L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "Comments", "Provided under the terms of the GNU General Public License (LGPLv2.1+).\0"
+ VALUE "CompanyName", "OpenSC Project\0"
+ VALUE "FileDescription", "OpenSSL PKCS#11 engine\0"
+ VALUE "FileVersion", "@ENGINE_PKCS11_VERSION_MAJOR@, at ENGINE_PKCS11_VERSION_MINOR@, at ENGINE_PKCS11_VERSION_FIX@,0\0"
+ VALUE "InternalName", "@PACKAGE_NAME@\0"
+ VALUE "LegalCopyright", "OpenSC Project\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "@PACKAGE_NAME at .dll\0"
+ VALUE "PrivateBuild", "\0"
+ VALUE "ProductName", "@PACKAGE_NAME@\0"
+ VALUE "ProductVersion", "@ENGINE_PKCS11_VERSION_MAJOR@, at ENGINE_PKCS11_VERSION_MINOR@, at ENGINE_PKCS11_VERSION_FIX@,0\0"
+ VALUE "SpecialBuild", "\0"
+ END
+ END
+END
+
diff --git a/svnignore b/svnignore
new file mode 100644
index 0000000..17c63bf
--- /dev/null
+++ b/svnignore
@@ -0,0 +1,55 @@
+Makefile
+Makefile.in
+core
+archive
+acinclude.m4
+aclocal.m4
+autom4te.cache
+compile
+confdefs.h
+config.*
+configure
+conftest
+conftest.c
+depcomp
+install-sh
+libtool
+libtool.m4
+ltmain.sh
+missing
+mkinstalldirs
+so_locations
+stamp-h*
+
+.deps
+.libs
+.#*#
+.*.bak
+.*.orig
+.*.rej
+.*~
+#*#
+*.bak
+*.d
+*.def
+*.dll
+*.exe
+*.la
+*.lib
+*.lo
+*.orig
+*.pdb
+*.rej
+*.u
+*.rc
+*.pc
+*~
+*.gz
+*.bz2
+*.[0-9]
+*.html
+*.gif
+*.css
+*.out
+
+ChangeLog
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opensc/engine-pkcs11.git
More information about the pkg-opensc-commit
mailing list