Here are changes to allow OpenSC to build under windows with the new my_getopt and strlcpy changes.
win/Make.rules.mak added /I$(TOPDIR)\src\common to get the my_getopts.h and strlcpy.h netkey-tools,c, eidenv.c util.c replaced #include <getopt.h> with #include <my_getopt.h> removed the #ifdef for HAVE_GETOPT_H my_getopt.h does the #ifdef HAVE_GETOPT_H and will use #include <getopt.h> if needed. pkcs11/Makefile.mak added ..\common\common.lib as the _strlcpy is in common.lib winconfig.h removed #define HAVE_GETOPT_H so my_getopt would be used. Changed verision number too, you may not want this part. common/Makefile.mak changed to use my_getopt.h and strlcpy.h and build strlcpy.obj pkcs15-piv.c added #include <internal.h> so as to pick up needed header files. It compiles, using vc++8.0 also known as VC++2005. I am still having maifiest problems but that is another issue. -- Douglas E. Engert <[EMAIL PROTECTED]> Argonne National Laboratory 9700 South Cass Avenue Argonne, Illinois 60439 (630) 252-5444
Index: win32/Make.rules.mak =================================================================== --- win32/Make.rules.mak (revision 3001) +++ win32/Make.rules.mak (working copy) @@ -21,7 +21,7 @@ PROGRAMS_OPENSSL = pkcs15-init.exe cryptoflex-tool.exe netkey-tool.exe !ENDIF -COPTS = /D_CRT_SECURE_NO_DEPRECATE /Zi /MD /nologo /DHAVE_CONFIG_H /I$(TOPDIR)\src\include /I$(TOPDIR)\src\include\opensc $(OPENSSL_INCL_DIR) $(LIBLTDL_INCL) /D_WIN32_WINNT=0x0400 $(OPENSSL_DEF) +COPTS = /D_CRT_SECURE_NO_DEPRECATE /Zi /MD /nologo /DHAVE_CONFIG_H /I$(TOPDIR)\src\include /I$(TOPDIR)\src\include\opensc /I$(TOPDIR)\src\common $(OPENSSL_INCL_DIR) $(LIBLTDL_INCL) /D_WIN32_WINNT=0x0400 $(OPENSSL_DEF) LINKFLAGS = /DEBUG /NOLOGO /INCREMENTAL:NO /MACHINE:IX86 Index: src/tools/netkey-tool.c =================================================================== --- src/tools/netkey-tool.c (revision 3001) +++ src/tools/netkey-tool.c (working copy) @@ -33,9 +33,7 @@ #include <stdio.h> #include <stdlib.h> -#ifdef HAVE_GETOPT_H -# include <getopt.h> -#endif +#include <my_getopt.h> #include <string.h> #include <errno.h> #include <opensc/opensc.h> Index: src/tools/eidenv.c =================================================================== --- src/tools/eidenv.c (revision 3001) +++ src/tools/eidenv.c (working copy) @@ -26,7 +26,7 @@ #include <unistd.h> #endif #include <stdlib.h> -#include <getopt.h> +#include <my_getopt.h> #include <string.h> #include <opensc/opensc.h> #include <opensc/asn1.h> Index: src/tools/util.h =================================================================== --- src/tools/util.h (revision 3001) +++ src/tools/util.h (working copy) @@ -16,9 +16,7 @@ #include <unistd.h> #endif #include <sys/stat.h> -#ifdef HAVE_GETOPT_H -#include <getopt.h> -#endif +#include <my_getopt.h> #include <opensc/opensc.h> #ifdef __cplusplus Index: src/pkcs11/Makefile.mak =================================================================== --- src/pkcs11/Makefile.mak (revision 3001) +++ src/pkcs11/Makefile.mak (working copy) @@ -20,8 +20,8 @@ !INCLUDE $(TOPDIR)\win32\Make.rules.mak -$(TARGET): $(OBJECTS) ..\libopensc\opensc.lib ..\scconf\scconf.lib ..\pkcs15init\pkcs15init.lib - link $(LINKFLAGS) /dll /out:$(TARGET) $(OBJECTS) ..\libopensc\opensc.lib ..\scconf\scconf.lib ..\pkcs15init\pkcs15init.lib winscard.lib $(OPENSSL_LIB) $(LIBLTDL) gdi32.lib +$(TARGET): $(OBJECTS) ..\libopensc\opensc.lib ..\scconf\scconf.lib ..\pkcs15init\pkcs15init.lib ..\common\common.lib + link $(LINKFLAGS) /dll /out:$(TARGET) $(OBJECTS) ..\libopensc\opensc.lib ..\scconf\scconf.lib ..\pkcs15init\pkcs15init.lib ..\common\common.lib winscard.lib $(OPENSSL_LIB) $(LIBLTDL) gdi32.lib $(TARGET2): $(OBJECTS2) lib /nologo /machine:ix86 /out:$(TARGET2) $(OBJECTS2) $(LIBLTDL_LIB) Index: src/include/winconfig.h =================================================================== --- src/include/winconfig.h (revision 3001) +++ src/include/winconfig.h (working copy) @@ -64,7 +64,6 @@ #define F_OK 0 /* test whether exist. */ #endif -#define HAVE_GETOPT_H #define HAVE_IO_H #define HAVE_GETPASS #define HAVE_PCSC @@ -72,7 +71,7 @@ #define PATH_MAX _MAX_PATH #ifndef VERSION -#define VERSION "0.11.1" +#define VERSION "0.11.2" #endif /* src/common/getpass.c */ Index: src/common/Makefile.mak =================================================================== --- src/common/Makefile.mak (revision 3001) +++ src/common/Makefile.mak (working copy) @@ -1,9 +1,9 @@ TOPDIR = ..\.. -HEADERS = getopt.h my_getopt.h +HEADERS = my_getopt.h strlcpy.h HEADERSDIR = $(TOPDIR)\src\include TARGET = common.lib -OBJECTS = getpass.obj my_getopt.obj +OBJECTS = getpass.obj my_getopt.obj strlcpy.obj all: install-headers $(TARGET) Index: src/libopensc/pkcs15-piv.c =================================================================== --- src/libopensc/pkcs15-piv.c (revision 3001) +++ src/libopensc/pkcs15-piv.c (working copy) @@ -19,6 +19,7 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "internal.h" #include <stdlib.h> #include <string.h>
_______________________________________________ opensc-devel mailing list opensc-devel@lists.opensc-project.org http://www.opensc-project.org/mailman/listinfo/opensc-devel