Changeset 81


Ignore:
Timestamp:
04/04/08 22:22:33 (4 years ago)
Author:
alonbl
Message:

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

Location:
trunk
Files:
5 deleted
9 edited
8 copied

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      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
  • trunk/Makefile.am

    r56 r81  
    1 # Process this file with automake to create Makefile.in 
    21 
    3 SUBDIRS = . aclocal src  
    4 DIST_SUBDIRS = . aclocal doc src  
     2AUTOMAKE_OPTIONS = foreign 1.10 
     3MAINTAINERCLEANFILES = \ 
     4        config.log config.status \ 
     5        $(srcdir)/Makefile.in \ 
     6        $(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \ 
     7        $(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \ 
     8        $(srcdir)/depcomp $(srcdir)/aclocal.m4 \ 
     9        $(srcdir)/config.guess $(srcdir)/config.sub \ 
     10        $(srcdir)/packaged 
     11EXTRA_DIST = svnignore 
    512 
    6 EXTRA_DIST = NEWS bootstrap depcomp  
     13SUBDIRS = src doc 
    714 
    8 MAINTAINERCLEANFILES = \ 
    9         Makefile.in config.h.in configure \ 
    10         install-sh ltmain.sh missing mkinstalldirs \ 
    11         compile depcomp config.log config.status \ 
    12         config.guess config.sub acinclude.m4 aclocal.m4 
     15dist_noinst_SCRIPTS = bootstrap 
     16dist_doc_DATA = NEWS 
    1317 
    14 DEPCLEANFILES = config.log configure 
    15  
    16 AUTOMAKE_OPTIONS = foreign 1.5 
    17 ACLOCAL_AMFLAGS = -I aclocal 
     18# Allow detection of packaged tarball 
     19dist-hook: 
     20        echo > "$(distdir)/packaged" 
  • trunk/configure.ac

    r60 r81  
    1 dnl -*- mode: m4; -*- 
    2 dnl Process this file with autoconf to produce a configure script. 
    3  
    4 # Require autoconf 2.52 
    5 AC_PREREQ(2.52) 
    6  
    7 AC_INIT(engine_pkcs11, [0.1.4-svn]) 
    8  
    9 AM_INIT_AUTOMAKE 
    10 AM_CONFIG_HEADER(config.h) 
     1 
     2AC_PREREQ([2.60]) 
     3 
     4define([PACKAGE_VERSION_MAJOR], [0]) 
     5define([PACKAGE_VERSION_MINOR], [1]) 
     6define([PACKAGE_VERSION_FIX], [4]) 
     7 
     8AC_INIT([engine_pkcs11], [PACKAGE_VERSION_MAJOR.PACKAGE_VERSION_MINOR.PACKAGE_VERSION_FIX-svn]) 
     9AC_CONFIG_AUX_DIR([.]) 
     10AM_CONFIG_HEADER([config.h]) 
     11AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}]) 
     12 
     13ENGINE_PKCS11_VERSION_MAJOR="PACKAGE_VERSION_MAJOR" 
     14ENGINE_PKCS11_VERSION_MINOR="PACKAGE_VERSION_MINOR" 
     15ENGINE_PKCS11_VERSION_FIX="PACKAGE_VERSION_FIX" 
    1116 
    1217AC_CONFIG_SRCDIR(src/engine_pkcs11.c) 
    13  
    1418 
    1519AC_CANONICAL_HOST 
    1620AC_PROG_CC 
     21PKG_PROG_PKG_CONFIG 
    1722AC_C_BIGENDIAN 
    1823 
    19 dnl Options 
    20 AM_MAINTAINER_MODE 
     24AC_MSG_CHECKING([svn checkout]) 
     25if test -e packaged; then 
     26        svn_checkout="no" 
     27else 
     28        svn_checkout="yes" 
     29fi 
     30AC_MSG_RESULT([${svn_checkout}]) 
     31 
     32AC_ARG_WITH( 
     33        [cygwin-native], 
     34        [AC_HELP_STRING([--with-cygwin-native], [compile native win32])], 
     35        , 
     36        [with_cygwin_native="no"] 
     37) 
     38 
     39dnl Check for some target-specific stuff 
     40test -z "${WIN32}" && WIN32="no" 
     41test -z "${CYGWIN}" && CYGWIN="no" 
     42case "${host}" in 
     43        *-mingw32*|*-winnt*) 
     44                WIN32="yes" 
     45                CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN" 
     46                WIN_LIBPREFIX="lib" 
     47        ;; 
     48        *-cygwin*) 
     49                AC_MSG_CHECKING([cygwin mode to use]) 
     50                CYGWIN="yes" 
     51                if test "${with_cygwin_native}" = "yes"; then 
     52                        AC_MSG_RESULT([Using native win32]) 
     53                        CPPFLAGS="${CPPFLAGS} -DWIN32_LEAN_AND_MEAN" 
     54                        CFLAGS="${CFLAGS} -mno-cygwin" 
     55                        WIN32="yes" 
     56                else 
     57                        AC_MSG_RESULT([Using cygwin]) 
     58                        CPPFLAGS="${CPPFLAGS} -DCRYPTOKI_FORCE_WIN32" 
     59                        WIN_LIBPREFIX="cyg" 
     60                        AC_DEFINE([USE_CYGWIN], [1], [Define if you are on Cygwin]) 
     61                fi 
     62        ;; 
     63esac 
     64 
     65AC_ARG_ENABLE( 
     66        [strict], 
     67        [AC_HELP_STRING([--enable-strict], [enable strict compile mode @<:@disabled@:>@])], 
     68        , 
     69        [enable_strict="no"] 
     70) 
     71 
     72AC_ARG_ENABLE( 
     73        [pedantic], 
     74        [AC_HELP_STRING([--enable-pedantic], [enable pedantic compile mode @<:@disabled@:>@])], 
     75        , 
     76        [enable_pedantic="no"] 
     77) 
     78 
     79AC_ARG_ENABLE( 
     80        [doc], 
     81        [AC_HELP_STRING([--enable-doc], [enable installation of documents. @<:@disabled@:>@])], 
     82        , 
     83        [enable_doc="no"] 
     84) 
     85 
     86AC_ARG_WITH( 
     87        [enginesdir], 
     88        [AC_HELP_STRING([--with-enginesdir], [OpenSSL engines directory. @<:@/usr/lib/engines@:>@])], 
     89        [enginesdir="${withval}"], 
     90        [enginesdir="\$(libdir)/engines"] 
     91) 
    2192 
    2293dnl Checks for programs. 
     
    2495AC_PROG_INSTALL 
    2596AC_PROG_LN_S 
     97AC_PROG_MKDIR_P 
     98AC_PROG_SED 
    2699AC_PROG_MAKE_SET 
    27100 
    28101dnl Add libtool support. 
    29 AM_PROG_LIBTOOL 
    30 dnl Automatically update the libtool script if it becomes out-of-date. 
    31 #AC_SUBST(LIBTOOL_DEPS) 
     102AC_LIBTOOL_WIN32_DLL 
     103AC_LIBTOOL_RC 
     104AC_PROG_LIBTOOL 
    32105 
    33106dnl Checks for header files. 
    34107AC_HEADER_STDC 
    35108AC_HEADER_SYS_WAIT 
    36 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]) 
    37  
    38 PKG_CHECK_MODULES([LIBP11], [libp11 >= 0.2.1]) 
    39  
    40 dnl The big mess with OpenSSL 
    41 saved_LIBS="$LIBS" 
    42 saved_LDFLAGS="$LDFLAGS" 
    43 saved_CPPFLAGS="$CPPFLAGS" 
    44  
    45 SSL_MSG="no" 
    46 ssldir="" 
    47  
    48 AC_ARG_WITH(openssl, 
    49         AC_HELP_STRING([--with-openssl=PATH], [use OpenSSL in PATH]), 
     109AC_CHECK_HEADERS([ \ 
     110        errno.h fcntl.h malloc.h stdlib.h inttypes.h \ 
     111        string.h strings.h sys/time.h unistd.h \ 
     112        locale.h getopt.h dlfcn.h utmp.h \ 
     113]) 
     114 
     115PKG_CHECK_MODULES([LIBP11], [libp11 >= 0.2.1],, [AC_MSG_ERROR([libp11 is required])]) 
     116 
     117dnl These required for svn checkout 
     118AC_ARG_VAR([XSLTPROC], [xsltproc utility]) 
     119AC_ARG_VAR([SVN], [subversion utility]) 
     120AC_ARG_VAR([WGET], [wget utility]) 
     121AC_ARG_VAR([WGET_OPTS], [wget options]) 
     122AC_ARG_VAR([TR], [tr utility]) 
     123AC_CHECK_PROGS([XSLTPROC],[xsltproc]) 
     124AC_CHECK_PROGS([SVN],[svn]) 
     125AC_CHECK_PROGS([WGET],[wget]) 
     126AC_CHECK_PROGS([TR],[tr]) 
     127test -z "${WGET_OPTS}" && WGET_OPTS="-nv" 
     128 
     129dnl svn checkout dependencies 
     130if test "${svn_checkout}" = "yes"; then 
     131        AC_MSG_CHECKING([XSLTPROC requirement]) 
     132        if test -n "${XSLTPROC}"; then 
     133                AC_MSG_RESULT([ok]) 
     134        else 
     135                if test "${enable_doc}" = "yes"; then 
     136                        AC_MSG_ERROR([Missing XSLTPROC svn build with doc]) 
     137                else 
     138                        AC_MSG_WARN(["make dist" will not work]) 
     139                fi 
     140        fi 
     141 
     142        AC_MSG_CHECKING([svn doc build dependencies]) 
     143        if test -n "${SVN}" -a -n "${TR}" -a -n "${WGET}"; then 
     144                AC_MSG_RESULT([ok]) 
     145        else 
     146                if test "${enable_doc}" = "yes"; then 
     147                        AC_MSG_ERROR([Missing SVN, TR or WGET for svn doc build]) 
     148                else 
     149                        AC_MSG_WARN(["make dist" will not work]) 
     150                fi 
     151        fi 
     152fi 
     153 
     154PKG_CHECK_MODULES( 
     155        [OPENSSL], 
     156        [libcrypto >= 0.9.7], 
     157        , 
     158        [PKG_CHECK_MODULES( 
     159                [OPENSSL], 
     160                [openssl >= 0.9.7], 
     161                , 
     162                [AC_CHECK_LIB( 
     163                        [crypto], 
     164                        [RSA_version], 
     165                        [OPENSSL_LIBS="-lcrypto"], 
     166                        [AC_MSG_ERROR([Cannot find OpenSSL])] 
     167                )] 
     168        )] 
     169) 
     170 
     171# ok, now we might (or not) have ssl and an engine. 
     172# still room for "improvements", i.e. hacks to work 
     173# with old engines. 
     174 
     175AC_MSG_CHECKING([for openssl version]) 
     176saved_CPPFLAGS="${CPPFLAGS}" 
     177CPPFLAGS="${CPPFLAGS} ${OPENSSL_CFLAGS}" 
     178AC_EGREP_CPP( 
     179        [new], 
    50180        [ 
    51                 # Disable OpenSSL support 
    52                 if test "x$withval" = "xno" ; then 
    53                         SSL_MSG="no (disabled)" 
    54                         break; 
    55                 fi 
    56  
    57                 # ok we got a directory, so only check in that dir. 
    58                 LIBCRYPTO="-lcrypto" 
    59                 CPPFLAGS="$saved_CPPFLAGS" 
    60                 LDFLAGS="$saved_LDFLAGS" 
    61                 LIBS="$LIBCRYPTO $saved_LIBS" 
    62                 LDFLAGS="-L$withval/lib $saved_LDFLAGS" 
    63                 if test ! -z "$need_dash_r" ; then 
    64                         LDFLAGS="-R$withval/lib $LDFLAGS" 
    65                 fi 
    66                 CPPFLAGS="-I$withval/include $saved_CPPFLAGS" 
    67  
    68                 AC_TRY_RUN( 
    69                         [ 
    70 #include <string.h> 
    71 #include <openssl/rand.h> 
    72 int main(void) 
    73 { 
    74         char a[2048]; 
    75         memset(a, 0, sizeof(a)); 
    76         RAND_add(a, sizeof(a), sizeof(a)); 
    77         return(RAND_status() <= 0); 
    78 } 
    79                         ], 
    80                         [ 
    81                                 SSL_MSG="yes" 
    82                                 ssldir="$withval" 
    83                                 break 
    84                         ]) 
    85                         ],[ 
    86  
    87         # we didn't get a directory, so we start searching for openssl 
    88         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 
    89                 # Skip directories if they don't exist 
    90                 if test ! -d "$tryssldir/" ; then 
    91                         continue; 
    92                 fi 
    93  
    94                 LIBCRYPTO="-lcrypto" 
    95                 CPPFLAGS="$saved_CPPFLAGS" 
    96                 LDFLAGS="$saved_LDFLAGS" 
    97                 LIBS="$saved_LIBS $LIBCRYPTO" 
    98  
    99                 if test "x$tryssldir" != "x/usr"; then 
    100                         LDFLAGS="-L$tryssldir/lib $saved_LDFLAGS" 
    101                         if test ! -z "$need_dash_r" ; then 
    102                                 LDFLAGS="-R$tryssldir/lib $LDFLAGS" 
    103                         fi 
    104                         CPPFLAGS="-I$tryssldir/include $saved_CPPFLAGS" 
    105                 fi 
    106  
    107                 # Basic test to check for compatible version and correct linking 
    108                 # *does not* test for RSA - that comes later. 
    109                 AC_TRY_RUN( 
    110                         [ 
    111 #include <string.h> 
    112 #include <openssl/rand.h> 
    113 int main(void) 
    114 { 
    115         char a[2048]; 
    116         memset(a, 0, sizeof(a)); 
    117         RAND_add(a, sizeof(a), sizeof(a)); 
    118         return(RAND_status() <= 0); 
    119 } 
    120                         ], 
    121                         [ 
    122                                 SSL_MSG="yes" 
    123                                 ssldir=$tryssldir 
    124                                 break; 
    125                         ], 
    126                         [ 
    127                                 SSL_MSG="no" 
    128                                 LIBS="$saved_LIBS" 
    129                                 LDFLAGS="$saved_LDFLAGS" 
    130                                 CPPFLAGS="$saved_CPPFLAGS" 
    131                         ]) 
    132         done 
    133         ]) 
    134 LIBS="$saved_LIBS" 
    135 AC_SUBST(LIBCRYPTO) 
    136 AM_CONDITIONAL(HAVE_SSL, test "x$SSL_MSG" = "xyes") 
    137  
    138 if test "x$SSL_MSG" = "xyes" ; then 
    139   AC_DEFINE(HAVE_OPENSSL, 1, [Have OpenSSL libraries]) 
    140 else 
    141   LIBCRYPTO="" 
    142 fi 
    143  
    144 # ok, we checked for basic ssl support. 
    145 # if it is not available, we can skip the rest of 
    146 # the test. also we have $ssldir set to the location 
    147 # of the openssl libs. 
    148  
    149 ENGINE_MSG="no" 
    150 if test "x$SSL_MSG" = "xyes"; then 
    151         # engine has to be there and working 
    152         LIBS="$saved_LIBS $LIBCRYPTO $LIBDL" 
    153         AC_TRY_RUN( 
     181#include <openssl/opensslv.h> 
     182#if OPENSSL_VERSION_NUMBER >= 0x0090704fL 
     183new 
     184#else 
     185old 
     186#endif 
     187        ], 
    154188        [ 
     189                AC_MSG_RESULT([good, 0.9.7d or later]) 
     190                old_openssl="no" 
     191        ], 
     192        [ 
     193                AC_MSG_RESULT([not so good, 0.9.7d or later would be better]) 
     194                old_openssl="yes" 
     195        ] 
     196) 
     197CPPFLAGS="${saved_CPPFLAGS}" 
     198 
     199if test "x$old_openssl" = "xyes"; then 
     200        # openssl found, but version less than 0.9.7d 
     201        # linking libcrypto.a statically possible? 
     202 
     203        saved_CFLAGS="${CFLAGS}" 
     204        saved_LIBS="${LIBS}" 
     205        CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}" 
     206        if echo "${OPENSSL_LIBS}" | grep -- "-L" > /dev/null; then 
     207                OPENSSL_DIR="$(echo "${OPENSSL_LIBS}" | ${SED} 's/.*-L\([^ ]*\).*/\1/')" 
     208        else 
     209                OPENSSL_DIR="${usrlibdir}" 
     210        fi 
     211        LIBS="${LIBS} ${OPENSSL_DIR}/libcrypto.a" 
     212        AC_CHECK_LIB( 
     213                [dl], 
     214                [dlopen] 
     215        ) 
     216        AC_MSG_CHECKING([should link static openssl]) 
     217        AC_LINK_IFELSE( 
     218                [AC_LANG_PROGRAM([[ 
    155219#include <string.h> 
    156220#include <openssl/opensslv.h> 
    157221#include <openssl/engine.h> 
    158222#include <openssl/rand.h> 
    159 int main(void) 
     223int test(void) 
    160224{ 
    161225        char a[2048]; 
     
    169233        return(RAND_status() <= 0); 
    170234} 
    171         ], 
    172         [ 
    173                 ENGINE_MSG=yes 
    174                 ENGINE_LINK="$LIBCRYPTO" 
    175         ], 
    176         [ 
    177                 ENGINE_MSG=no 
    178         ]) 
    179 fi 
    180 LIBS="$saved_LIBS" 
    181 AC_SUBST(ENGINE_LINK) 
    182 AM_CONDITIONAL(HAVE_ENGINE, test "x$ENGINE_MSG" = "xyes") 
    183  
    184 # ok, now we might (or not) have ssl and an engine. 
    185 # still room for "improvements", i.e. hacks to work 
    186 # with old engines. 
    187  
    188 SSLHACK_MSG=no 
    189 if test "x$SSL_MSG" = "xyes" -a "x$ENGINE_MSG" = "xyes"; then 
    190         # latest openssl version with engine 
    191         # properly integrated? 
    192         AC_MSG_CHECKING([for openssl version]) 
    193         AC_TRY_RUN( 
    194         [ 
    195 #include <stdlib.h> 
    196 #include <string.h> 
    197 #include <openssl/opensslv.h> 
    198  
    199 int main(void) 
    200 { 
    201         if(OPENSSL_VERSION_NUMBER >= 0x0090704fL) { 
    202                 exit(0); 
    203         } else { 
    204                 exit(1); 
    205         } 
    206 } 
    207         ], 
    208         [ 
    209                 AC_MSG_RESULT([good, 0.9.7d or later]) 
    210                 OLD_OPENSSL=no 
    211         ], 
    212         [ 
    213                 AC_MSG_RESULT([not so good, 0.9.7d or later would be better]) 
    214                 OLD_OPENSSL=yes 
    215         ]) 
    216  
    217         if test "x$OLD_OPENSSL" = "xyes"; then 
    218                 # openssl found, but version less than 0.9.7d 
    219                 # linking libcrypto.a statically possible? 
    220  
    221                 LIBS="$saved_LIBS $ssldir/lib/libcrypto.a $LIBDL" 
    222                 AC_TRY_RUN( 
     235                ]])], 
    223236                [ 
    224 #include <string.h> 
    225 #include <openssl/opensslv.h> 
    226 #include <openssl/engine.h> 
    227 #include <openssl/rand.h> 
    228 int main(void) 
    229 { 
    230         char a[2048]; 
    231         ENGINE *e; 
    232  
    233         e = ENGINE_new(); 
    234         ENGINE_load_dynamic(); 
    235         if (!e) return 1; 
    236         memset(a, 0, sizeof(a)); 
    237         RAND_add(a, sizeof(a), sizeof(a)); 
    238         return(RAND_status() <= 0); 
    239 } 
     237                        AC_MSG_RESULT([yes]) 
     238                        ENGINE_LINK="${OPENSSL_DIR}/libcrypto.a" 
    240239                ], 
    241                 [ 
    242                         SSLHACK_MSG=yes 
    243                         ENGINE_LINK="$ssldir/lib/libcrypto.a" 
    244                 ]) 
    245                 LIBS="$saved_LIBS" 
    246         fi 
    247 fi 
    248  
     240                [AC_MSG_ERROR([OpenSSL is old and cannot link with its static library])] 
     241        ) 
     242        CFLAGS="${saved_CFLAGS}" 
     243        LIBS="${saved_LIBS}" 
     244fi 
     245 
     246#@alonbl: This was never actually used. 
     247# 
    249248# now - last part to do: check if we gain anything from 
    250249# funny parameters to link openssl with. 
    251  
    252 saved_LDFLAGS="$LDFLAGS" 
    253 if test "x$ENGINE_MSG" = "xyes" ; then 
    254   for openssl_ldflag in "-Wl,-Bsymbolic" "-G -Wl,-Bsymbolic" "-shared -G -Wl,-Bsymbolic" "-Wl,-all_load"; do 
    255         AC_MSG_CHECKING([whether we can use $openssl_ldflag]) 
    256         LDFLAGS="$saved_LDFLAGS $openssl_ldflag" 
    257         AC_TRY_LINK(,[return 1],ac_cv_use_openssl_flag="yes",ac_cv_use_openssl_flag="no") 
    258         AC_MSG_RESULT($ac_cv_use_openssl_flag) 
    259         if test "$ac_cv_use_openssl_flag" = "yes"; then 
    260                 OPENSSL_LDFLAGS="$openssl_ldflag" 
    261                 break; 
    262         fi 
    263   done 
    264 fi 
    265 LDFLAGS="$saved_LDFLAGS" 
    266 AC_SUBST(OPENSSL_LDFLAGS) 
     250#saved_LDFLAGS="${LDFLAGS}" 
     251#for test_flags in "-Wl,-Bsymbolic" "-G -Wl,-Bsymbolic" "-Wl,-all_load"; do 
     252#       AC_MSG_CHECKING([whether we can use ${test_flags}]) 
     253#       LDFLAGS="${saved_LDFLAGS} ${test_flags}" 
     254#       AC_LINK_IFELSE( 
     255#               [AC_LANG_PROGRAM([[ 
     256#int test() 
     257#{ 
     258#       return 1; 
     259#} 
     260#               ]])], 
     261#               [result="yes"], 
     262#               [result="no"] 
     263#       ) 
     264#       AC_MSG_RESULT([${result}]) 
     265#       if test "${result}" = "yes"; then 
     266#               OPENSSL_EXTRA_LDFLAGS="${test_flags}" 
     267#               break; 
     268#       fi 
     269#done 
     270#LDFLAGS="${saved_LDFLAGS}" 
     271 
     272 
     273AC_SUBST([enginesdir]) 
     274AC_SUBST([ENGINE_LINK]) 
     275AC_SUBST([ENGINE_PKCS11_VERSION_MAJOR]) 
     276AC_SUBST([ENGINE_PKCS11_VERSION_MINOR]) 
     277AC_SUBST([ENGINE_PKCS11_VERSION_FIX]) 
     278AC_SUBST([WIN_LIBPREFIX]) 
     279AC_SUBST([OPENSSL_EXTRA_LDFLAGS]) 
     280 
     281AM_CONDITIONAL([SVN_CHECKOUT], [test "${svn_checkout}" = "yes"]) 
     282AM_CONDITIONAL([WIN32], [test "${WIN32}" = "yes"]) 
     283AM_CONDITIONAL([CYGWIN], [test "${CYGWIN}" = "yes"]) 
     284AM_CONDITIONAL([ENABLE_DOC], [test "${enable_doc}" = "yes"]) 
     285 
     286if test "${enable_pedantic}" = "yes"; then 
     287        enable_strict="yes"; 
     288        CFLAGS="${CFLAGS} -pedantic" 
     289fi 
     290if test "${enable_strict}" = "yes"; then 
     291        CFLAGS="${CFLAGS} -Wall -Wextra" 
     292fi 
    267293 
    268294AC_OUTPUT([ 
    269 Makefile 
    270 aclocal/Makefile 
    271 doc/Makefile 
    272 src/Makefile 
     295        Makefile 
     296        doc/Makefile 
     297        doc/nonpersistent/Makefile 
     298        src/Makefile 
     299        src/versioninfo.rc 
    273300]) 
    274301 
    275 echo "" 
    276 echo "Engine_pkcs11 has been configured with the following options" 
    277  
    278 echo "" 
    279 echo "OpenSSL support:          ${SSL_MSG}" 
    280 echo "        with engine:      ${ENGINE_MSG}" 
    281 echo "        with sslhack:     ${SSLHACK_MSG}" 
    282 echo "" 
     302cat <<EOF 
     303 
     304engine_pkcs11 has been configured with the following options: 
     305 
     306 
     307Version:                 ${PACKAGE_VERSION} 
     308Libraries:               $(eval eval eval echo "${libdir}") 
     309 
     310doc support:             ${enable_doc} 
     311 
     312Host:                    ${host} 
     313Compiler:                ${CC} 
     314Preprocessor flags:      ${CPPFLAGS} 
     315Compiler flags:          ${CFLAGS} 
     316Linker flags:            ${LDFLAGS} 
     317Libraries:               ${LIBS} 
     318 
     319enginesdir               ${enginesdir} 
     320 
     321LIBP11_CFLAGS:           ${LIBP11_CFLAGS} 
     322LIBP11_LIBS:             ${LIBP11_LIBS} 
     323OPENSSL_CFLAGS:          ${OPENSSL_CFLAGS} 
     324OPENSSL_LIBS:            ${OPENSSL_LIBS} 
     325OPENSSL_EXTRA_LDFLAGS:   ${OPENSSL_EXTRA_LDFLAGS} 
     326ENGINE_LINK:             ${ENGINE_LINK} 
     327 
     328EOF 
  • trunk/doc

    • Property svn:ignore set to
      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
  • trunk/doc/Makefile.am

    r22 r81  
    1 # Process this file with automake to create Makefile.in 
     1MAINTAINERCLEANFILES = $(srcdir)/Makefile.in 
    22 
    3 MAINTAINERCLEANFILES = Makefile.in $(HTML) ChangeLog 
     3if ENABLE_DOC 
     4SUBDIRS = nonpersistent 
     5endif 
     6DIST_SUBDIRS = nonpersistent 
    47 
    5 EXTRA_DIST = README export-wiki.sh export-wiki.xsl $(HTML) index.html ChangeLog 
    6  
    7 HTML= $(shell ls $(srcdir)/*.html $(srcdir)/*.css) 
    8  
    9 index.html: 
    10         sh $(srcdir)/export-wiki.sh $(srcdir) 
    11  
    12 ChangeLog: 
    13         sh $(srcdir)/changelog.sh $(srcdir) 
     8dist_doc_DATA = README 
  • trunk/src

    • Property svn:ignore set to
      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
  • trunk/src/Makefile.am

    r25 r81  
    1 # Process this file with automake to create Makefile.in 
    2  
    3 enginedir = $(libdir)/engines 
    4  
    5 MAINTAINERCLEANFILES = Makefile.in 
    6  
     1MAINTAINERCLEANFILES = $(srcdir)/Makefile.in 
    72EXTRA_DIST = Makefile.mak engine_pkcs11.def  
    83 
    9 engine_LTLIBRARIES = engine_pkcs11.la 
     4engines_LTLIBRARIES = engine_pkcs11.la 
    105 
    11 OPENSSL_CFLAGS = \ 
     6OPENSSL_EXTRA_CFLAGS = \ 
    127        -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H \ 
    138        -DOPENSSL_NO_KRB5 -DL_ENDIAN -DTERMIO -DENGINE_DYNAMIC_SUPPORT \ 
     
    1510 
    1611engine_pkcs11_la_SOURCES = \ 
    17         hw_pkcs11.c engine_pkcs11.c engine_pkcs11.h  
    18 engine_pkcs11_la_CFLAGS = $(OPENSSL_CFLAGS) $(LIBP11_CFLAGS) -I$(srcdir)/../libp11  
     12        hw_pkcs11.c engine_pkcs11.c engine_pkcs11.h  \ 
     13        engine_pkcs11.exports 
     14if WIN32 
     15nodist_engine_pkcs11_la_SOURCES = versioninfo.rc 
     16endif 
     17engine_pkcs11_la_CFLAGS = $(AM_CFLAGS) $(OPENSSL_EXTRA_CFLAGS) $(OPENSSL_CFLAGS) \ 
     18        $(LIBP11_CFLAGS) 
    1919engine_pkcs11_la_LIBADD = $(ENGINE_LINK) $(OPENSSL_LIBS) $(LIBP11_LIBS) 
    20 engine_pkcs11_la_LDFLAGS = -module -avoid-version 
     20engine_pkcs11_la_LDFLAGS = $(AM_LDFLAGS) $(OPENSSL_EXTRA_LDFLAGS) \ 
     21        -module -avoid-version \ 
     22        -export-symbols "$(srcdir)/engine_pkcs11.exports" \ 
     23        -no-undefined 
     24 
     25install-data-hook: 
     26        rm -f "$(DESTDIR)$(enginesdir)/engine_pkcs11.la" 
     27        rm -f "$(DESTDIR)$(enginesdir)/engine_pkcs11.a" 
     28        rm -f "$(DESTDIR)$(enginesdir)/engine_pkcs11.dll.a" 
     29 
     30RCCOMPILE = $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 
     31        $(AM_CPPFLAGS) $(CPPFLAGS) 
     32LTRCCOMPILE = $(LIBTOOL) --mode=compile --tag=RC $(RCCOMPILE) 
     33 
     34.rc.lo: 
     35        $(LTRCCOMPILE) -i "$<" -o "$@" 
     36 
     37.rc.o: 
     38        $(RCCOMPILE) -i "$<" -o "$@" 
     39 
  • trunk/src/engine_pkcs11.c

    r63 r81  
    2626 */ 
    2727 
     28#include <config.h> 
    2829#include <stdio.h> 
    2930#include <string.h> 
     
    6364        module = strdup(modulename); 
    6465        return 1; 
     66} 
     67 
     68/** 
     69 * Set the PIN used for login. A copy of the PIN shall be made. 
     70 * 
     71 * If the PIN cannot be assigned, the value 0 shall be returned 
     72 * and errno shall be set as follows: 
     73 * 
     74 *   EINVAL - a NULL PIN was supplied 
     75 *   ENOMEM - insufficient memory to copy the PIN 
     76 * 
     77 * @param _pin the pin to use for login. Must not be NULL. 
     78 * 
     79 * @return 1 on success, 0 on failure. 
     80 */ 
     81int set_pin(const char *_pin) 
     82{ 
     83        /* Pre-condition check */ 
     84        if (_pin == NULL) { 
     85                errno = EINVAL; 
     86                return 0; 
     87        } 
     88 
     89        /* Copy the PIN. If the string cannot be copied, NULL 
     90           shall be returned and errno shall be set. */ 
     91        pin = strdup(_pin); 
     92 
     93        return (pin != NULL); 
    6594} 
    6695 
  • trunk/src/hw_pkcs11.c

    r55 r81  
    6060 */ 
    6161 
     62#include <config.h> 
    6263#include <stdio.h> 
    6364#include <string.h> 
Note: See TracChangeset for help on using the changeset viewer.