Hi Karsten,

I figured out what the FLEX_INC should be and get musclecard.dll compiled. However, there are a few warnings:

1 ..\src\PCSC\win32\thread_generic.h(44) : warning C4003: not enough actual parame
   - corresponding code:
    #define PCSCLITE_THREAD_FUNCTION(f)      void *(*f)(void *)
int SYS_ThreadCreate(PCSCLITE_THREAD_T *, int, PCSCLITE_THREAD_FUNCTION( ), LPVOID);

2. ..\src\musclecard.c(377) : warning C4090: '=' : different 'const'
  - the cast below may help
from
        pConnection->ioType = SCARD_PCI_T0;
to
        (const SCARD_IO_REQUEST *) pConnection->ioType = SCARD_PCI_T0;

3 ..\src\tokenparser.c(1481) : warning C4013: 'exit' undefined; assuming
  - this seems to be the stdlib.h not included problem

Rgds.
Martin
=======================================================================
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\win32\PCSC.cpp
PCSC.cpp
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\src\debuglog.c
debuglog.c
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\src\dyn_win32.c
dyn_win32.c
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\src\musclecard.c
musclecard.c
..\src\PCSC\win32\thread_generic.h(44) : warning C4003: not enough actual parame
ters for macro 'PCSCLITE_THREAD_FUNCTION'
..\src\musclecard.c(377) : warning C4090: '=' : different 'const' qualifiers
..\src\musclecard.c(380) : warning C4090: '=' : different 'const' qualifiers
..\src\musclecard.c(383) : warning C4090: '=' : different 'const' qualifiers
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\win32\StdAfx.cpp
StdAfx.cpp
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\src\strlcat.c
strlcat.c
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\src\strlcpy.c
strlcpy.c
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\src\thread_unix.c
thread_unix.c
..\src\PCSC\win32\thread_generic.h(44) : warning C4003: not enough actual parame
ters for macro 'PCSCLITE_THREAD_FUNCTION'
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\src\tokenfactory.c
tokenfactory.c
cl.exe /nologo /MD /W3 /GX /O2 /I d:\MyCodes\muscle\pthread\v1.11.0\incl ude /I ..\src\PCSC\win32 /I c:\Progra~1\GnuWin32\include /I "." /D "WIN32" /D " NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "USE_THREAD_SAFETY" /D "PCSC_EX
PORTS" /FoRelease/ /FdRelease/ /TC /FD /c ..\src\tokenparser.c
tokenparser.c
..\src\tokenparser.c(1481) : warning C4013: 'exit' undefined; assuming extern re
turning int
..\src\tokenparser.c(1544) : warning C4013: 'malloc' undefined; assuming extern
returning int
..\src\tokenparser.c(1562) : warning C4013: 'realloc' undefined; assuming extern
 returning int
..\src\tokenparser.c(1572) : warning C4013: 'free' undefined; assuming extern re
turning int
link.exe winscard.lib advapi32.lib pthreadVC1.lib /nologo /dll /incremen tal:no /pdb:Release\musclecard.pdb /machine:I386 /out:Release\musclecard.dll /i mplib:Release\musclecard.lib /libpath:D:\MyCodes\muscle\pthread\v1.11.0\lib Rele ase\PCSC.obj Release\debuglog.obj Release\dyn_win32.obj Release\musclecard.ob j Release\StdAfx.obj Release\strlcat.obj Release\strlcpy.obj Release\thread_
unix.obj  Release\tokenfactory.obj  Release\tokenparser.obj
Creating library Release\musclecard.lib and object Release\musclecard.exp echo /nologo /MD /W3 /GX /O2 /I ..\src\PCSC\win32 /I "." /D "WIN32" /D
"NDEBUG" /D "_WINDOWS" /D "_MBCS" /FoRelease/ /FdRelease/ /TC /FD /c
/nologo /MD /W3 /GX /O2 /I ..\src\PCSC\win32 /I "." /D "WIN32" /D "NDEBUG" /D "_
WINDOWS" /D "_MBCS" /FoRelease/ /FdRelease/ /TC /FD /c
cl.exe /nologo /MD /W3 /GX /O2 /I ..\src\PCSC\win32 /I "." /D "WIN32" / D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /FoRelease/ /FdRelease/ /TC /FD /c ..\utils\
bundleTool\bundleTool.c
bundleTool.c
link.exe winscard.lib advapi32.lib /nologo /incremental:no /pdb:Release\ bundleTool.pdb /machine:I386 /out:Release\bundleTool.exe Release\bundleTool.obj




Martin Leung wrote:
Hi Karten,

Thanks for the info but I still have a few queries:

1. I didn't find the pthread lib/dll in your zip file so I got it from redhat. There are 2 versions, 1.11 and 2.70. Which one should I use?

2. Do I need a FLEX_INC? Where can I get the flex include files?

3. I got the following error with nmake:

PCSC.mak(27) : fatal error U1050: Your path to the header file needed to compile C files generated by flex is wrong. A file called unistd.h is needed to compile C files generated by flex. Replace it in the Makefile or call nmake with FLEX_I
NC=<HEADERS_NEEDED_TO_COMPILE_FLEX_FILES>

What did I miss? Below is my build file:
==========================================================
@echo off

rem - download flex from http://gnuwin32.sourceforge.net/packages/flex.htm

rem Possible arguments:
rem PTHREADS_INC  - Path to pthreads includes
rem PTHREADS_LIB  - Path to pthreads link library (.lib)
rem PTHREADS_NAME - Name of pthreads library (without extension)
rem FLEX          - Path including file name of the flex executable
rem FLEX_INC      - Path to shipped flex includes
rem PCSC_INC      - Path to PC/SC Lite includes

rem set PTHREADS_VER=v2.7.0
set PTHREADS_VER=v1.11.0
set PTHREADS_INC=d:\MyCodes\muscle\pthread\%PTHREADS_VER%\include
set PTHREADS_LIB=D:\MyCodes\muscle\pthread\%PTHREADS_VER%\lib
set PTHREADS_NAME=pthreadVC1
set FLEX=c:\Progra~1\GnuWin32\bin\flex.exe
set FLEX_INC=
set PCSC_INC=..\src\PCSC\win32

cd "C:\Program Files\Microsoft Visual Studio\VC98\Bin"
if not .%_SET_VCVARS%==.Y call c:vcvars32.bat
if not .%_SET_VCVARS%==.Y set _SET_VCVARS=Y
c:nmake -f PCSC.mak PTHREADS_INC=%PTHREADS_INC% PTHREADS_LIB=%PTHREADS_LIB% PTHREADS_NAME=%PTHREADS_NAME% FLEX=%FLEX% PCSC_INC=%PCSC_INC%

Rgds.
Martin

Karsten Ohme wrote:

Martin Leung wrote:

Hi,

I am trying to build libmusclecard on Win32 and have a few questions.



Use this one:

http://www.inf.tu-dresden.de/~ko189283/MuscleCard/

It is a new version of the whole MuscleCard chain in development. But it should work. Read the README or the Install.w32 respectively. You can load everything to benefit (or that it works at all). Everything there should be adapted to this (The PKCS#11 does not contain the last patches.)

But read this at the beginning to see the changes:

http://www.inf.tu-dresden.de/~ko189283/MuscleCard/libmusclecardChanges.html


1. How to create tokenparser.c on Win32?



Flex/Bison for Windows. If you read the Install.w32 thsi is clear and will know how to get it. There is also a free build version if you have no Visual Studio. Else use nmake of Visual Studio. Well, everything mentioned in the install.w32.


   There is no tokenparser.c in cvs. I downloaded the src to Fedora
   and make tokenparser.c there.  Is this the right way to do so?

   Also, the tokenparser.c generated in this way doesn't include
   <stdlib.h> (probably c_plusplus is not defined). Can I pass a
   flag to bootstrap/configure/make to get stdlib include?

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5

#include <stdio.h>

/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>

/* Use prototypes in function declarations. */
#define YY_USE_PROTOS


2. Should pcsc extension in pcsclite.h be extracted into a separate
   header file,say, pcsc_ext.h?

   The current pcsclite.h reads:

#ifdef WIN32
#include <winscard.h>
#else
... win32 winscard equivalent ...
... pcsclite extensions ....
#endif

   Win32 fails to compile due to missing of pcsclite extensions. Should
   I extract the extensions to another file and include it inside
   pcsclite.h?

3. How to handle unistd.h?

   Multiple src files contain:

#include <unistd.h>

   that causes error when compiling on win32. Should I use the
   flag HAVE_UNISTD_H config.h.in or simply use,

#if !defined(WIN32)
#include <unistd.h>
#endif

4. To get tokenparser.c to compile on win32, I've to define:

#define YY_NEVER_INTERACTIVE 1

   Is it correct? Should this go to win32/config.h

5. Currently MSC_SVC_DROPDIR is hardcoded:

#define MSC_SVC_DROPDIR "C:\\Program Files\\Muscle\\Services"

   On Win32, I would suggest to read it from registry as in the
   case of PKCS11. Any comment?



Done. It works this way in my version.

Regards, Karsten



Rgds.
Martin


------------------------------------------------------------------------

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle



_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle



_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to