diff --git a/configure.ac b/configure.ac index b8224b5de7..265332c7c5 100644 --- a/configure.ac +++ b/configure.ac @@ -980,6 +980,15 @@ if test "${enable_sm}" = "yes"; then esac fi +case "${host}" in + *-winnt*|*-cygwin*) + win_abs_top_srcdir="$(cygpath --windows $(realpath ${srcdir}))" + ;; + *) + win_abs_top_srcdir="$(realpath ${srcdir})" + ;; +esac + if test "${with_pkcs11_provider}" = "detect"; then if test "${WIN32}" != "yes"; then DEFAULT_PKCS11_PROVIDER="${libdir}/opensc-pkcs11${DYN_LIB_EXT}" @@ -1126,6 +1135,7 @@ AC_SUBST([PROFILE_DIR_DEFAULT]) AC_SUBST([OPTIONAL_NOTIFY_CFLAGS]) AC_SUBST([OPTIONAL_NOTIFY_LIBS]) AC_SUBST([TIDY_CHECKS]) +AC_SUBST([win_abs_top_srcdir]) AM_CONDITIONAL([ENABLE_MAN], [test "${enable_man}" = "yes"]) AM_CONDITIONAL([ENABLE_THREAD_LOCKING], [test "${enable_thread_locking}" = "yes"]) @@ -1173,27 +1183,29 @@ AC_CONFIG_FILES([ src/common/Makefile src/ui/Makefile src/libopensc/Makefile + src/libopensc/libopensc.rc src/sm/Makefile src/pkcs11/Makefile - src/pkcs11/versioninfo-pkcs11.rc - src/pkcs11/versioninfo-pkcs11-spy.rc + src/pkcs11/opensc-pkcs11.rc + src/pkcs11/opensc-pkcs11-spy.rc src/pkcs11/opensc-pkcs11.pc src/pkcs15init/Makefile src/scconf/Makefile src/tests/Makefile + src/tests/tests.rc src/tests/regression/Makefile src/tests/p11test/Makefile src/tests/fuzzing/Makefile src/tests/unittests/Makefile src/tools/Makefile - src/tools/versioninfo-tools.rc - src/tools/versioninfo-opensc-notify.rc + src/tools/tools.rc + src/tools/opensc-notify.rc src/smm/Makefile + src/smm/smm-local.rc src/minidriver/Makefile - src/minidriver/versioninfo-minidriver.rc + src/minidriver/opensc-minidriver.rc src/minidriver/opensc-minidriver.inf win32/Makefile - win32/versioninfo.rc win32/versioninfo-customactions.rc win32/winconfig.h win32/OpenSC.iss diff --git a/src/libopensc/Makefile.am b/src/libopensc/Makefile.am index ffce861b2c..5bf0fa8f62 100644 --- a/src/libopensc/Makefile.am +++ b/src/libopensc/Makefile.am @@ -74,7 +74,7 @@ libopensc_la_SOURCES = $(libopensc_la_SOURCES_BASE) \ libopensc_static_la_SOURCES = $(libopensc_la_SOURCES_BASE) if WIN32 -libopensc_la_SOURCES += $(top_builddir)/win32/versioninfo.rc +libopensc_la_SOURCES += libopensc.rc endif libopensc_la_LIBADD = $(OPENPACE_LIBS) $(OPTIONAL_OPENSSL_LIBS) \ $(OPTIONAL_OPENCT_LIBS) $(OPTIONAL_ZLIB_LIBS) \ diff --git a/src/libopensc/Makefile.mak b/src/libopensc/Makefile.mak index 588c013287..1c0675b00b 100644 --- a/src/libopensc/Makefile.mak +++ b/src/libopensc/Makefile.mak @@ -38,7 +38,7 @@ OBJECTS = \ pkcs15-esteid2018.obj pkcs15-idprime.obj pkcs15-nqApplet.obj \ pkcs15-starcos-esign.obj pkcs15-skeid.obj pkcs15-eoi.obj compression.obj sm.obj \ aux-data.obj \ - $(TOPDIR)\win32\versioninfo.res + libopensc.res LIBS = $(TOPDIR)\src\scconf\scconf.lib \ $(TOPDIR)\src\common\common.lib \ $(TOPDIR)\src\common\libscdl.lib \ @@ -48,7 +48,7 @@ LIBS = $(TOPDIR)\src\scconf\scconf.lib \ $(TOPDIR)\src\sm\libsmeac.lib \ $(TOPDIR)\src\pkcs15init\pkcs15init.lib -all: $(TOPDIR)\win32\versioninfo.res $(TARGET) +all: libopensc.res $(TARGET) !INCLUDE $(TOPDIR)\win32\Make.rules.mak @@ -57,7 +57,6 @@ opensc.dll: $(OBJECTS) $(LIBS) echo EXPORTS >> $*.def type lib$*.exports >> $*.def link $(LINKFLAGS) /dll /def:$*.def /implib:$*.lib /out:opensc.dll $(OBJECTS) $(LIBS) $(OPENPACE_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) gdi32.lib Comctl32.lib Shell32.lib user32.lib advapi32.lib ws2_32.lib shlwapi.lib - if EXIST opensc.dll.manifest mt -manifest opensc.dll.manifest -outputresource:opensc.dll;2 opensc_a.lib: $(OBJECTS) lib $(LIBFLAGS) /out:opensc_a.lib $(OBJECTS) diff --git a/src/minidriver/versioninfo-minidriver.rc.in b/src/libopensc/libopensc.rc.in similarity index 77% rename from src/minidriver/versioninfo-minidriver.rc.in rename to src/libopensc/libopensc.rc.in index 4844a14b00..d32e7e3c1c 100644 --- a/src/minidriver/versioninfo-minidriver.rc.in +++ b/src/libopensc/libopensc.rc.in @@ -1,15 +1,5 @@ #include -#define IDC_STATIC -1 -/* defined twice: in resource file and in source code */ -#define IDI_SMARTCARD 102 - -#ifndef __MINGW32__ -IDI_SMARTCARD ICON "..\\..\\win32\\DDORes.dll_14_2302.ico" -#else -IDI_SMARTCARD ICON "../../win32/DDORes.dll_14_2302.ico" -#endif - VS_VERSION_INFO VERSIONINFO FILEVERSION @OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@ PRODUCTVERSION @OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@ @@ -37,7 +27,7 @@ BEGIN VALUE "ProductName", "@OPENSC_VS_FF_PRODUCT_NAME@" VALUE "ProductVersion", "@OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@" VALUE "SpecialBuild", "" - VALUE "FileDescription", "OpenSC minidriver" + VALUE "FileDescription", "OpenSC internal library" END END BLOCK "VarFileInfo" @@ -45,3 +35,9 @@ BEGIN VALUE "Translation", 0x409, 1200 END END + +#ifndef __MINGW32__ +2 RT_MANIFEST "@win_abs_top_srcdir@\\src\\libopensc\\opensc.dll.manifest" +#else +2 RT_MANIFEST "@win_abs_top_srcdir@/src/libopensc/opensc.dll.manifest" +#endif diff --git a/src/minidriver/Makefile.am b/src/minidriver/Makefile.am index 4e7165ad55..cfe0fab33c 100644 --- a/src/minidriver/Makefile.am +++ b/src/minidriver/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/win32/ltrc.inc -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/versioninfo-minidriver.rc -EXTRA_DIST = Makefile.mak versioninfo-minidriver.rc.in opensc-minidriver.dll.manifest +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/opensc-minidriver.rc +EXTRA_DIST = Makefile.mak opensc-minidriver.rc.in opensc-minidriver.dll.manifest if ENABLE_MINIDRIVER lib_LTLIBRARIES = opensc-minidriver@LIBRARY_BITNESS@.la @@ -15,7 +15,7 @@ endif AM_CFLAGS = $(OPTIONAL_OPENSSL_CFLAGS) $(OPENPACE_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src -opensc_minidriver@LIBRARY_BITNESS@_la_SOURCES = minidriver.c minidriver.exports versioninfo-minidriver.rc +opensc_minidriver@LIBRARY_BITNESS@_la_SOURCES = minidriver.c minidriver.exports opensc-minidriver.rc opensc_minidriver@LIBRARY_BITNESS@_la_LIBADD = \ $(top_builddir)/src/libopensc/libopensc_static.la \ $(OPTIONAL_OPENSSL_LIBS) \ diff --git a/src/minidriver/Makefile.mak b/src/minidriver/Makefile.mak index abde6e20ea..ce28fbcd47 100644 --- a/src/minidriver/Makefile.mak +++ b/src/minidriver/Makefile.mak @@ -1,7 +1,7 @@ TOPDIR = ..\.. TARGET = opensc-minidriver.dll -OBJECTS = minidriver.obj versioninfo-minidriver.res +OBJECTS = minidriver.obj opensc-minidriver.res LIBS = $(TOPDIR)\src\libopensc\opensc_a.lib \ $(TOPDIR)\src\scconf\scconf.lib \ $(TOPDIR)\src\common\common.lib \ @@ -21,4 +21,3 @@ $(TARGET): $(OBJECTS) $(LIBS) echo EXPORTS >> $*.def type minidriver.exports >> $*.def link /dll $(LINKFLAGS) /def:$*.def /out:$(TARGET) $(OBJECTS) $(LIBS) $(ZLIB_LIB) $(OPENPACE_LIB) $(OPENSSL_LIB) ws2_32.lib gdi32.lib Comctl32.lib advapi32.lib Crypt32.lib User32.lib bcrypt.lib DelayImp.lib Rpcrt4.lib Shell32.lib Comctl32.lib Winmm.lib shlwapi.lib /DELAYLOAD:bcrypt.dll - if EXIST $(TARGET).manifest mt -manifest $(TARGET).manifest -outputresource:$(TARGET);2 diff --git a/src/minidriver/opensc-minidriver.rc.in b/src/minidriver/opensc-minidriver.rc.in new file mode 100644 index 0000000000..42b92caf25 --- /dev/null +++ b/src/minidriver/opensc-minidriver.rc.in @@ -0,0 +1,53 @@ +#include + +#define IDC_STATIC -1 +/* defined twice: in resource file and in source code */ +#define IDI_SMARTCARD 102 + +#ifndef __MINGW32__ +IDI_SMARTCARD ICON "@win_abs_top_srcdir@\\win32\\DDORes.dll_14_2302.ico" +#else +IDI_SMARTCARD ICON "@win_abs_top_srcdir@/win32/DDORes.dll_14_2302.ico" +#endif + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@ + PRODUCTVERSION @OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@ + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x21L +#else + FILEFLAGS 0x20L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "@OPENSC_VS_FF_COMMENTS@" + VALUE "CompanyName", "@OPENSC_VS_FF_COMPANY_NAME@" + VALUE "FileVersion", "@OPENSC_VERSION_MAJOR@.@OPENSC_VERSION_MINOR@.@OPENSC_VERSION_FIX@.@OPENSC_VERSION_REVISION@" + VALUE "InternalName", "@PACKAGE_NAME@" + VALUE "LegalCopyright", "@OPENSC_VS_FF_LEGAL_COPYRIGHT@" + VALUE "LegalTrademarks", "" + VALUE "PrivateBuild", "" + VALUE "ProductName", "@OPENSC_VS_FF_PRODUCT_NAME@" + VALUE "ProductVersion", "@OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@" + VALUE "SpecialBuild", "" + VALUE "FileDescription", "OpenSC minidriver" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#ifndef __MINGW32__ +2 RT_MANIFEST "@win_abs_top_srcdir@\\src\\minidriver\\opensc-minidriver.dll.manifest" +#else +2 RT_MANIFEST "@win_abs_top_srcdir@/src/minidriver/opensc-minidriver.dll.manifest" +#endif diff --git a/src/pkcs11/Makefile.am b/src/pkcs11/Makefile.am index 8fb404a09a..2bdd311191 100644 --- a/src/pkcs11/Makefile.am +++ b/src/pkcs11/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/win32/ltrc.inc -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/versioninfo-pkcs11.rc $(srcdir)/versioninfo-pkcs11-spy.rc -EXTRA_DIST = Makefile.mak versioninfo-pkcs11.rc.in versioninfo-pkcs11-spy.rc.in opensc-pkcs11.pc.in opensc-pkcs11.dll.manifest +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/opensc-pkcs11.rc $(srcdir)/opensc-pkcs11-spy.rc +EXTRA_DIST = Makefile.mak opensc-pkcs11.rc.in opensc-pkcs11-spy.rc.in opensc-pkcs11.pc.in opensc-pkcs11.dll.manifest if ENABLE_SHARED lib_LTLIBRARIES = opensc-pkcs11.la pkcs11-spy.la @@ -55,8 +55,8 @@ pkcs11_spy_la_LDFLAGS = $(AM_LDFLAGS) \ -module -shared -avoid-version -no-undefined if WIN32 -opensc_pkcs11_la_SOURCES += versioninfo-pkcs11.rc -pkcs11_spy_la_SOURCES += versioninfo-pkcs11-spy.rc +opensc_pkcs11_la_SOURCES += opensc-pkcs11.rc +pkcs11_spy_la_SOURCES += opensc-pkcs11-spy.rc pkcs11_spy_la_LIBADD += -lshlwapi endif diff --git a/src/pkcs11/Makefile.mak b/src/pkcs11/Makefile.mak index bbcd856c01..cdbe188e18 100644 --- a/src/pkcs11/Makefile.mak +++ b/src/pkcs11/Makefile.mak @@ -5,8 +5,8 @@ TARGET3 = pkcs11-spy.dll OBJECTS = pkcs11-global.obj pkcs11-session.obj pkcs11-object.obj misc.obj slot.obj \ mechanism.obj openssl.obj framework-pkcs15.obj framework-pkcs15init.obj \ - debug.obj pkcs11-display.obj versioninfo-pkcs11.res -OBJECTS3 = pkcs11-spy.obj pkcs11-display.obj versioninfo-pkcs11-spy.res + debug.obj pkcs11-display.obj opensc-pkcs11.res +OBJECTS3 = pkcs11-spy.obj pkcs11-display.obj opensc-pkcs11-spy.res LIBS = $(TOPDIR)\src\libopensc\opensc_a.lib \ $(TOPDIR)\src\pkcs15init\pkcs15init.lib \ @@ -26,8 +26,6 @@ all: $(TARGET1) $(TARGET3) $(TARGET1): $(OBJECTS) $(LIBS) link $(LINKFLAGS) /dll /implib:$*.lib /out:$(TARGET1) $(OBJECTS) $(LIBS) $(OPENPACE_LIB) $(OPENSSL_LIB) $(ZLIB_LIB) gdi32.lib Comctl32.lib Shell32.lib user32.lib advapi32.lib ws2_32.lib Shell32.lib Comctl32.lib shlwapi.lib - if EXIST $(TARGET1).manifest mt -manifest $(TARGET1).manifest -outputresource:$(TARGET1);2 $(TARGET3): $(OBJECTS3) $(LIBS3) link $(LINKFLAGS) /dll /implib:$*.lib /out:$(TARGET3) $(OBJECTS3) $(LIBS3) $(OPENSSL_LIB) gdi32.lib advapi32.lib shlwapi.lib - if EXIST $(TARGET3).manifest mt -manifest $(TARGET3).manifest -outputresource:$(TARGET3);2 diff --git a/src/pkcs11/versioninfo-pkcs11-spy.rc.in b/src/pkcs11/opensc-pkcs11-spy.rc.in similarity index 100% rename from src/pkcs11/versioninfo-pkcs11-spy.rc.in rename to src/pkcs11/opensc-pkcs11-spy.rc.in diff --git a/src/pkcs11/versioninfo-pkcs11.rc.in b/src/pkcs11/opensc-pkcs11.rc.in similarity index 86% rename from src/pkcs11/versioninfo-pkcs11.rc.in rename to src/pkcs11/opensc-pkcs11.rc.in index e8bc91d3be..256a158bf8 100644 --- a/src/pkcs11/versioninfo-pkcs11.rc.in +++ b/src/pkcs11/opensc-pkcs11.rc.in @@ -36,3 +36,8 @@ BEGIN END END +#ifndef __MINGW32__ +2 RT_MANIFEST "@win_abs_top_srcdir@\\src\\pkcs11\\opensc-pkcs11.dll.manifest" +#else +2 RT_MANIFEST "@win_abs_top_srcdir@/src/pkcs11/opensc-pkcs11.dll.manifest" +#endif diff --git a/src/smm/Makefile.am b/src/smm/Makefile.am index 097f045f28..0590a8516b 100644 --- a/src/smm/Makefile.am +++ b/src/smm/Makefile.am @@ -2,7 +2,7 @@ MAINTAINERCLEANFILES = Makefile.in -EXTRA_DIST = Makefile.mak smm-local.dll.manifest +EXTRA_DIST = Makefile.mak smm-local.rc.in smm-local.dll.manifest AM_CFLAGS = $(OPTIONAL_OPENSSL_CFLAGS) $(OPTIONAL_READLINE_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/common -I$(top_builddir)/src/include @@ -20,6 +20,9 @@ libsmm_local_la_SOURCES = smm-local.c sm-module.h \ sm-global-platform.c sm-cwa14890.c \ sm-card-authentic.c sm-card-iasecc.c \ smm-local.exports +if WIN32 +libsmm_local_la_SOURCES += smm-local.rc +endif libsmm_local_la_LIBADD = $(OPTIONAL_OPENSSL_LIBS) libsmm_local_la_LDFLAGS = -module -shared -no-undefined -version-info @OPENSC_LT_CURRENT@:@OPENSC_LT_REVISION@:@OPENSC_LT_AGE@ diff --git a/src/smm/Makefile.mak b/src/smm/Makefile.mak index b8cc25319c..f304409b65 100644 --- a/src/smm/Makefile.mak +++ b/src/smm/Makefile.mak @@ -2,7 +2,7 @@ TOPDIR = ..\.. TARGET = smm-local.dll -OBJECTS = smm-local.obj sm-global-platform.obj sm-cwa14890.obj sm-card-iasecc.obj sm-card-authentic.obj +OBJECTS = smm-local.obj sm-global-platform.obj sm-cwa14890.obj sm-card-iasecc.obj sm-card-authentic.obj smm-local.res LIBS = $(TOPDIR)\src\sm\libsm.lib \ $(TOPDIR)\src\libopensc\opensc_a.lib \ $(TOPDIR)\src\pkcs15init\pkcs15init.lib \ @@ -15,7 +15,7 @@ LIBS = $(TOPDIR)\src\sm\libsm.lib \ $(TOPDIR)\src\sm\libsmeac.lib \ $(TOPDIR)\src\pkcs15init\pkcs15init.lib -all: $(TARGET) +all: smm-local.res $(TARGET) !INCLUDE $(TOPDIR)\win32\Make.rules.mak @@ -25,7 +25,6 @@ $(TARGET): $(OBJECTS) $(LIBS) echo EXPORTS >> $*.def type $*.exports >> $*.def link /dll $(LINKFLAGS) /def:$*.def /out:$(TARGET) $(OBJECTS) $(LIBS) $(ZLIB_LIB) $(OPENPACE_LIB) $(OPENSSL_LIB) ws2_32.lib gdi32.lib advapi32.lib Crypt32.lib User32.lib Shell32.lib Comctl32.lib shlwapi.lib - if EXIST $(TARGET).manifest mt -manifest $(TARGET).manifest -outputresource:$(TARGET);2 !ELSE $(TARGET): diff --git a/src/smm/smm-local.rc.in b/src/smm/smm-local.rc.in new file mode 100644 index 0000000000..31e8eb1414 --- /dev/null +++ b/src/smm/smm-local.rc.in @@ -0,0 +1,43 @@ +#include + +VS_VERSION_INFO VERSIONINFO + FILEVERSION @OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@ + PRODUCTVERSION @OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@ + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x21L +#else + FILEFLAGS 0x20L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "@OPENSC_VS_FF_COMMENTS@" + VALUE "CompanyName", "@OPENSC_VS_FF_COMPANY_NAME@" + VALUE "FileVersion", "@OPENSC_VERSION_MAJOR@.@OPENSC_VERSION_MINOR@.@OPENSC_VERSION_FIX@.@OPENSC_VERSION_REVISION@" + VALUE "InternalName", "@PACKAGE_NAME@" + VALUE "LegalCopyright", "@OPENSC_VS_FF_LEGAL_COPYRIGHT@" + VALUE "LegalTrademarks", "" + VALUE "PrivateBuild", "" + VALUE "ProductName", "@OPENSC_VS_FF_PRODUCT_NAME@" + VALUE "ProductVersion", "@OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@" + VALUE "SpecialBuild", "" + VALUE "FileDescription", "OpenSC secure messaging module" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#ifndef __MINGW32__ +2 RT_MANIFEST "@win_abs_top_srcdir@\\src\\smm\\smm-local.dll.manifest" +#else +2 RT_MANIFEST "@win_abs_top_srcdir@/src/smm/smm-local.dll.manifest" +#endif diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index cd5573068a..42c5f49382 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -1,7 +1,7 @@ include $(top_srcdir)/win32/ltrc.inc MAINTAINERCLEANFILES = $(srcdir)/Makefile.in -EXTRA_DIST = Makefile.mak +EXTRA_DIST = Makefile.mak tests.rc.in tests.manifest SUBDIRS = regression p11test fuzzing unittests noinst_PROGRAMS = base64 lottery p15dump pintest prngtest @@ -23,9 +23,9 @@ pintest_SOURCES = pintest.c print.c $(COMMON_SRC) $(COMMON_INC) prngtest_SOURCES = prngtest.c $(COMMON_SRC) $(COMMON_INC) if WIN32 -base64_SOURCES += $(top_builddir)/win32/versioninfo.rc -lottery_SOURCES += $(top_builddir)/win32/versioninfo.rc -p15dump_SOURCES += $(top_builddir)/win32/versioninfo.rc -pintest_SOURCES += $(top_builddir)/win32/versioninfo.rc -prngtest_SOURCES += $(top_builddir)/win32/versioninfo.rc +base64_SOURCES += tests.rc +lottery_SOURCES += tests.rc +p15dump_SOURCES += tests.rc +pintest_SOURCES += tests.rc +prngtest_SOURCES += tests.rc endif diff --git a/src/tests/Makefile.mak b/src/tests/Makefile.mak index 49ac651f74..62e8dab42c 100644 --- a/src/tests/Makefile.mak +++ b/src/tests/Makefile.mak @@ -3,7 +3,7 @@ TOPDIR = ..\.. TARGETS = base64.exe p15dump.exe opensc-minidriver-test.exe \ p15dump.exe pintest.exe # prngtest.exe lottery.exe -OBJECTS = print.obj sc-test.obj $(TOPDIR)\win32\versioninfo.res +OBJECTS = print.obj sc-test.obj tests.res LIBS = $(TOPDIR)\src\common\common.lib $(TOPDIR)\src\libopensc\opensc.lib all: $(TARGETS) @@ -15,9 +15,7 @@ $(TARGETS): $(OBJECTS) $(LIBS) opensc-minidriver-test.exe: cl $(COPTS) /c $*.c link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj bcrypt.lib ncrypt.lib crypt32.lib winscard.lib - if EXIST $@.manifest mt -manifest $@.manifest -outputresource:$@;1 .c.exe: cl $(COPTS) /c $< link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj $(OBJECTS) $(LIBS) - if EXIST $@.manifest mt -manifest $@.manifest -outputresource:$@;1 diff --git a/src/tests/fuzzing/Makefile.am b/src/tests/fuzzing/Makefile.am index 6b53b6343e..12e07574ec 100644 --- a/src/tests/fuzzing/Makefile.am +++ b/src/tests/fuzzing/Makefile.am @@ -55,3 +55,18 @@ fuzz_pkcs11_LDADD = \ $(top_builddir)/src/common/libpkcs11.la \ $(OPTIONAL_OPENSSL_LIBS) \ $(top_builddir)/src/pkcs11/libopensc-pkcs11.la + +if WIN32 +fuzz_asn1_print_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_asn1_sig_value_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_pkcs15_decode_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_pkcs15_reader_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_scconf_parse_string_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_pkcs15init_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_pkcs15_encode_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_card_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_piv_tool_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_pkcs15_tool_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_pkcs15_crypt_SOURCES += $(top_builddir)/src/tests/tests.rc +fuzz_pkcs11_SOURCES += $(top_builddir)/src/tests/tests.rc +endif diff --git a/src/tests/p11test/Makefile.am b/src/tests/p11test/Makefile.am index f5300b22df..454e70e5a8 100644 --- a/src/tests/p11test/Makefile.am +++ b/src/tests/p11test/Makefile.am @@ -38,5 +38,5 @@ p11test_CFLAGS = $(OPTIONAL_OPENSSL_CFLAGS) $(CMOCKA_CFLAGS) p11test_LDADD = $(OPTIONAL_OPENSSL_LIBS) $(CMOCKA_LIBS) $(LDL_LIBS) if WIN32 -p11test_SOURCES += $(top_builddir)/win32/versioninfo.rc +p11test_SOURCES += $(top_builddir)/src/tests/tests.rc endif diff --git a/src/tests/p11test/Makefile.mak b/src/tests/p11test/Makefile.mak index 197830137a..503f0f9e67 100644 --- a/src/tests/p11test/Makefile.mak +++ b/src/tests/p11test/Makefile.mak @@ -12,7 +12,7 @@ OBJECTS = p11test_loader.obj \ p11test_case_wait.obj \ p11test_case_pss_oaep.obj \ p11test_helpers.obj \ - $(TOPDIR)\win32\versioninfo.res + $(TOPDIR)\src\tests\tests.res all: $(TARGETS) @@ -23,4 +23,3 @@ $(TARGETS): $(OBJECTS) $(LIBS) .c.exe: cl $(COPTS) /c $< link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj $(OBJECTS) $(LIBS) - if EXIST $@.manifest mt -manifest $@.manifest -outputresource:$@;1 diff --git a/src/pkcs11/onepin-opensc-pkcs11.dll.manifest b/src/tests/tests.manifest similarity index 100% rename from src/pkcs11/onepin-opensc-pkcs11.dll.manifest rename to src/tests/tests.manifest diff --git a/win32/versioninfo.rc.in b/src/tests/tests.rc.in similarity index 84% rename from win32/versioninfo.rc.in rename to src/tests/tests.rc.in index 23cf3ed49f..88bf290f12 100644 --- a/win32/versioninfo.rc.in +++ b/src/tests/tests.rc.in @@ -27,7 +27,7 @@ BEGIN VALUE "ProductName", "@OPENSC_VS_FF_PRODUCT_NAME@" VALUE "ProductVersion", "@OPENSC_VERSION_MAJOR@,@OPENSC_VERSION_MINOR@,@OPENSC_VERSION_FIX@,@OPENSC_VERSION_REVISION@" VALUE "SpecialBuild", "" - VALUE "FileDescription", "OpenSC common usage application extension" + VALUE "FileDescription", "OpenSC test" END END BLOCK "VarFileInfo" @@ -36,3 +36,8 @@ BEGIN END END +#ifndef __MINGW32__ +1 RT_MANIFEST "@win_abs_top_srcdir@\\src\\tests\\tests.manifest" +#else +1 RT_MANIFEST "@win_abs_top_srcdir@/src/tests/tests.manifest" +#endif diff --git a/src/tests/unittests/Makefile.am b/src/tests/unittests/Makefile.am index 4c73911e48..fdfd872b6c 100644 --- a/src/tests/unittests/Makefile.am +++ b/src/tests/unittests/Makefile.am @@ -38,14 +38,29 @@ pkcs15filter_SOURCES = pkcs15-emulator-filter.c openpgp_tool_SOURCES = openpgp-tool.c $(top_builddir)/src/tools/openpgp-tool-helpers.c hextobin_SOURCES = hextobin.c decode_ecdsa_signature_SOURCES = decode_ecdsa_signature.c -check_macro_reference_loop = check_macro_reference_loop.c -strip_pkcs1_2_padding = strip_pkcs1_2_padding.c +check_macro_reference_loop_SOURCES = check_macro_reference_loop.c +strip_pkcs1_2_padding_SOURCES = strip_pkcs1_2_padding.c + +if WIN32 +asn1_SOURCES += $(top_builddir)/src/tests/tests.rc +simpletlv_SOURCES += $(top_builddir)/src/tests/tests.rc +cachedir_SOURCES += $(top_builddir)/src/tests/tests.rc +pkcs15filter_SOURCES += $(top_builddir)/src/tests/tests.rc +openpgp_tool_SOURCES += $(top_builddir)/src/tests/tests.rc +hextobin_SOURCES += $(top_builddir)/src/tests/tests.rc +decode_ecdsa_signature_SOURCES += $(top_builddir)/src/tests/tests.rc +check_macro_reference_loop_SOURCES += $(top_builddir)/src/tests/tests.rc +strip_pkcs1_2_padding_SOURCES += $(top_builddir)/src/tests/tests.rc +endif if ENABLE_ZLIB noinst_PROGRAMS += compression TESTS += compression compression_SOURCES = compression.c +if WIN32 +compression_SOURCES += $(top_builddir)/src/tests/tests.rc +endif compression_LDADD = $(LDADD) $(OPTIONAL_ZLIB_LIBS) endif @@ -54,6 +69,9 @@ noinst_PROGRAMS += sm TESTS += sm sm_SOURCES = sm.c +if WIN32 +sm_SOURCES += $(top_builddir)/src/tests/tests.rc +endif sm_LDADD = $(top_builddir)/src/sm/libsm.la $(LDADD) endif diff --git a/src/tests/unittests/Makefile.mak b/src/tests/unittests/Makefile.mak index 6284b51af9..633b260312 100644 --- a/src/tests/unittests/Makefile.mak +++ b/src/tests/unittests/Makefile.mak @@ -7,7 +7,7 @@ OBJECTS = asn1.obj \ pkcs15-emulator-filter.obj \ check_macro_reference_loop.obj \ strip_pkcs1_2_padding.obj \ - $(TOPDIR)\win32\versioninfo.res + $(TOPDIR)\src\tests\tests.res all: $(TARGETS) @@ -18,4 +18,3 @@ $(TARGETS): $(OBJECTS) $(LIBS) .c.exe: cl $(COPTS) /c $< link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj $(OBJECTS) $(LIBS) - if EXIST $@.manifest mt -manifest $@.manifest -outputresource:$@;1 diff --git a/src/tools/Makefile.am b/src/tools/Makefile.am index aab4a81163..62b61065d8 100644 --- a/src/tools/Makefile.am +++ b/src/tools/Makefile.am @@ -21,8 +21,8 @@ do_subst = $(SED) \ -e 's,[@]VDFORMAT[@],$(VDFORMAT),g' \ -e 's,[@]X509DIR[@],$(X509DIR),g' -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/versioninfo-tools.rc $(srcdir)/versioninfo-opensc-notify.rc -EXTRA_DIST = Makefile.mak versioninfo-tools.rc.in versioninfo-opensc-notify.rc.in goid-tool.ggo.in npa-tool.ggo.in opensc-notify.ggo.in egk-tool.ggo.in opensc-asn1.ggo.in org.opensc.notify.desktop.in exe.manifest pkcs11-register.desktop.in org.opensc-project.mac.pkcs11-register.plist.in org.opensc-project.mac.opensc-notify.plist.in +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/tools.rc $(srcdir)/opensc-notify.rc +EXTRA_DIST = Makefile.mak tools.rc.in opensc-notify.rc.in goid-tool.ggo.in npa-tool.ggo.in opensc-notify.ggo.in egk-tool.ggo.in opensc-asn1.ggo.in org.opensc.notify.desktop.in tools.manifest pkcs11-register.desktop.in org.opensc-project.mac.pkcs11-register.plist.in org.opensc-project.mac.opensc-notify.plist.in noinst_HEADERS = util.h fread_to_eof.h \ egk-tool-cmdline.h goid-tool-cmdline.h npa-tool-cmdline.h \ @@ -149,24 +149,24 @@ cmdline: if WIN32 LIBS += -lshlwapi -opensc_tool_SOURCES += versioninfo-tools.rc -piv_tool_SOURCES += versioninfo-tools.rc -opensc_explorer_SOURCES += versioninfo-tools.rc -pkcs15_tool_SOURCES += versioninfo-tools.rc -pkcs11_tool_SOURCES += versioninfo-tools.rc -pkcs11_register_SOURCES += versioninfo-tools.rc -pkcs15_crypt_SOURCES += versioninfo-tools.rc -cryptoflex_tool_SOURCES += versioninfo-tools.rc -pkcs15_init_SOURCES += versioninfo-tools.rc -cardos_tool_SOURCES += versioninfo-tools.rc -eidenv_SOURCES += versioninfo-tools.rc -netkey_tool_SOURCES += versioninfo-tools.rc -westcos_tool_SOURCES += versioninfo-tools.rc -openpgp_tool_SOURCES += versioninfo-tools.rc -iasecc_tool_SOURCES += versioninfo-tools.rc -sc_hsm_tool_SOURCES += versioninfo-tools.rc -gids_tool_SOURCES += versioninfo-tools.rc -opensc_notify_SOURCES += versioninfo-opensc-notify.rc +opensc_tool_SOURCES += tools.rc +piv_tool_SOURCES += tools.rc +opensc_explorer_SOURCES += tools.rc +pkcs15_tool_SOURCES += tools.rc +pkcs11_tool_SOURCES += tools.rc +pkcs11_register_SOURCES += tools.rc +pkcs15_crypt_SOURCES += tools.rc +cryptoflex_tool_SOURCES += tools.rc +pkcs15_init_SOURCES += tools.rc +cardos_tool_SOURCES += tools.rc +eidenv_SOURCES += tools.rc +netkey_tool_SOURCES += tools.rc +westcos_tool_SOURCES += tools.rc +openpgp_tool_SOURCES += tools.rc +iasecc_tool_SOURCES += tools.rc +sc_hsm_tool_SOURCES += tools.rc +gids_tool_SOURCES += tools.rc +opensc_notify_SOURCES += opensc-notify.rc endif applicationsdir = $(datadir)/applications diff --git a/src/tools/Makefile.mak b/src/tools/Makefile.mak index b2682727d2..f5ea607d5f 100644 --- a/src/tools/Makefile.mak +++ b/src/tools/Makefile.mak @@ -9,7 +9,7 @@ TARGETS = opensc-tool.exe opensc-explorer.exe pkcs15-tool.exe pkcs15-crypt.exe \ opensc-notify.exe egk-tool.exe goid-tool.exe dtrust-tool paccess-tool.exe \ opensc-asn1.exe pkcs11-register.exe $(PROGRAMS_OPENSSL) $(PROGRAMS_OPENPACE) -OBJECTS = util.obj versioninfo-tools.res +OBJECTS = util.obj tools.res LIBS = $(TOPDIR)\src\common\common.lib \ $(TOPDIR)\src\scconf\scconf.lib \ @@ -22,52 +22,42 @@ all: $(TARGETS) $(TARGETS): $(OBJECTS) $(LIBS) -opensc-notify.exe: opensc-notify-cmdline.obj versioninfo-opensc-notify.res $(LIBS) +opensc-notify.exe: opensc-notify-cmdline.obj opensc-notify.res $(LIBS) cl $(COPTS) /c $*.c - link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj opensc-notify-cmdline.obj versioninfo-opensc-notify.res $(LIBS) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 + link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj opensc-notify-cmdline.obj opensc-notify.res $(LIBS) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib npa-tool.exe: npa-tool-cmdline.obj fread_to_eof.obj $(OBJECTS) $(LIBS) cl $(COPTS) /c $*.c link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj npa-tool-cmdline.obj fread_to_eof.obj $(OBJECTS) $(LIBS) $(OPENPACE_LIB) $(OPENSSL_LIB) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 egk-tool.exe: egk-tool-cmdline.obj $(OBJECTS) $(LIBS) cl $(COPTS) /c $*.c link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj egk-tool-cmdline.obj $(OBJECTS) $(LIBS) $(ZLIB_LIB) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 goid-tool.exe: goid-tool-cmdline.obj fread_to_eof.obj $(OBJECTS) $(LIBS) cl $(COPTS) /c $*.c link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj goid-tool-cmdline.obj fread_to_eof.obj $(OBJECTS) $(LIBS) $(OPENPACE_LIB) $(OPENSSL_LIB) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 -opensc-asn1.exe: opensc-asn1-cmdline.obj fread_to_eof.obj versioninfo-tools.res $(LIBS) +opensc-asn1.exe: opensc-asn1-cmdline.obj fread_to_eof.obj tools.res $(LIBS) cl $(COPTS) /c $*.c - link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj opensc-asn1-cmdline.obj fread_to_eof.obj versioninfo-tools.res $(LIBS) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 + link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj opensc-asn1-cmdline.obj fread_to_eof.obj tools.res $(LIBS) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib -pkcs11-register.exe: pkcs11-register-cmdline.obj fread_to_eof.obj $(LIBS) +pkcs11-register.exe: pkcs11-register-cmdline.obj fread_to_eof.obj tools.res $(LIBS) cl $(COPTS) /c $*.c - link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj pkcs11-register-cmdline.obj fread_to_eof.obj versioninfo-tools.res $(LIBS) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 + link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj pkcs11-register-cmdline.obj fread_to_eof.obj tools.res $(LIBS) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib -pkcs15-tool.exe: pkcs15-tool.obj $(TOPDIR)\src\pkcs11\pkcs11-display.obj +pkcs15-tool.exe: pkcs15-tool.obj tools.res $(TOPDIR)\src\pkcs11\pkcs11-display.obj cl $(COPTS) /c $*.c link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj $(TOPDIR)\src\pkcs11\pkcs11-display.obj $(OBJECTS) $(LIBS) $(OPENSSL_LIB) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 -openpgp-tool.exe: openpgp-tool-helpers.obj $(LIBS) +openpgp-tool.exe: openpgp-tool-helpers.obj tools.res $(LIBS) cl $(COPTS) /c $*.c link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj openpgp-tool-helpers.obj $(OBJECTS) $(LIBS) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 sc-hsm-tool.exe: sc-hsm-tool.obj fread_to_eof.obj $(OBJECTS) $(LIBS) cl $(COPTS) /c $*.c link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj sc-hsm-tool.obj fread_to_eof.obj $(OBJECTS) $(LIBS) $(OPENSSL_LIB) gdi32.lib shell32.lib User32.lib ws2_32.lib - mt -manifest exe.manifest -outputresource:$@;1 .c.exe: cl $(COPTS) /c $< link $(LINKFLAGS) /pdb:$*.pdb /out:$@ $*.obj $(OBJECTS) $(LIBS) $(OPENSSL_LIB) gdi32.lib shell32.lib User32.lib ws2_32.lib shlwapi.lib - mt -manifest exe.manifest -outputresource:$@;1 diff --git a/src/tools/versioninfo-opensc-notify.rc.in b/src/tools/opensc-notify.rc.in similarity index 78% rename from src/tools/versioninfo-opensc-notify.rc.in rename to src/tools/opensc-notify.rc.in index 3b01d660b9..e85e34f065 100644 --- a/src/tools/versioninfo-opensc-notify.rc.in +++ b/src/tools/opensc-notify.rc.in @@ -5,9 +5,9 @@ #define IDI_SMARTCARD 102 #ifndef __MINGW32__ -IDI_SMARTCARD ICON "..\\..\\win32\\DDORes.dll_14_2302.ico" +IDI_SMARTCARD ICON "@win_abs_top_srcdir@\\win32\\DDORes.dll_14_2302.ico" #else -IDI_SMARTCARD ICON "../../win32/DDORes.dll_14_2302.ico" +IDI_SMARTCARD ICON "@win_abs_top_srcdir@/win32/DDORes.dll_14_2302.ico" #endif VS_VERSION_INFO VERSIONINFO @@ -45,3 +45,9 @@ BEGIN VALUE "Translation", 0x409, 1200 END END + +#ifndef __MINGW32__ +1 RT_MANIFEST "@win_abs_top_srcdir@\\src\\tools\\tools.manifest" +#else +1 RT_MANIFEST "@win_abs_top_srcdir@/src/tools/tools.manifest" +#endif diff --git a/src/tools/exe.manifest b/src/tools/tools.manifest similarity index 100% rename from src/tools/exe.manifest rename to src/tools/tools.manifest diff --git a/src/tools/versioninfo-tools.rc.in b/src/tools/tools.rc.in similarity index 88% rename from src/tools/versioninfo-tools.rc.in rename to src/tools/tools.rc.in index 444b1a2522..7459cee2a6 100644 --- a/src/tools/versioninfo-tools.rc.in +++ b/src/tools/tools.rc.in @@ -35,3 +35,9 @@ BEGIN VALUE "Translation", 0x409, 1200 END END + +#ifndef __MINGW32__ +1 RT_MANIFEST "@win_abs_top_srcdir@\\src\\tools\\tools.manifest" +#else +1 RT_MANIFEST "@win_abs_top_srcdir@/src/tools/tools.manifest" +#endif diff --git a/win32/Makefile.am b/win32/Makefile.am index 751f7ae498..f94128605f 100644 --- a/win32/Makefile.am +++ b/win32/Makefile.am @@ -1,11 +1,11 @@ include $(top_srcdir)/win32/ltrc.inc -MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/versioninfo.rc $(srcdir)/winconfig.h \ +MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/winconfig.h \ $(srcdir)/OpenSC.iss $(srcdir)/OpenSC.wxs $(srcdir)/versioninfo-customactions.rc -EXTRA_DIST = ltrc.inc Makefile.mak Make.rules.mak versioninfo.rc.in winconfig.h.in \ +EXTRA_DIST = ltrc.inc Makefile.mak Make.rules.mak winconfig.h.in \ OpenSC.iss.in OpenSC.wxs.in versioninfo-customactions.rc.in \ OpenSC.ico dlgbmp.bmp bannrbmp.bmp DDORes.dll_14_2302.ico -dist_noinst_HEADERS = versioninfo.rc winconfig.h OpenSC.iss OpenSC.wxs +dist_noinst_HEADERS = winconfig.h OpenSC.iss OpenSC.wxs if ENABLE_MINIDRIVER_SETUP_CUSTOMACTION lib_LTLIBRARIES = customactions@LIBRARY_BITNESS@.la