Builds lightweight Windows binaries by default

... without OpenSSL and zlib
This commit is contained in:
Frank Morgner 2015-09-23 08:21:57 +02:00
parent 97f8731402
commit a7bd14c77f
3 changed files with 51 additions and 34 deletions

View File

@ -1,18 +1,31 @@
version: 0.15.0.{build}
platform:
# the prebuilt zlib is 32 bit only
- x86
- x64
configuration:
- Release
- Debug
- Light-Release
- Light-Debug
environment:
matrix:
- VSVER: 12
- VSVER: 10
matrix:
allow_failures:
# the prebuilt zlib is 32 bit only
- platform: x64
configuration: Debug
- platform: x64
configuration: Release
# not included in AppVeyor right now
- platform: x64
VSVER: 10
install:
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/history?recordsNumber=50).builds | `
@ -37,22 +50,24 @@ install:
$env:ARTIFACT="OpenSC-${env:APPVEYOR_BUILD_VERSION}-win64_vs${env:VSVER}-${env:CONFIGURATION}.msi"
}
- ps: >-
If ($env:Configuration -Match "Debug") {
$env:NMAKE_DEBUG="DEBUG_DEF=/DDEBUG"
If ($env:Configuration -Like "*Debug*") {
$env:NMAKE_EXTRA="DEBUG_DEF=/DDEBUG ${env:NMAKE_EXTRA}"
}
- ps: >-
If (!($env:Configuration -Like "*Light*")) {
If (!(Test-Path -Path "C:\OpenSSL-${env:OPENSSL_PF}" )) {
Start-FileDownload https://slproweb.com/download/${env:OPENSSL_PF}OpenSSL-${env:OPENSSL_VER}.exe -FileName C:\WinOpenSSL.exe
C:\WinOpenSSL.exe /SILENT /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
}
If (!(Test-Path -Path "C:\zlib-dll" )) {
appveyor DownloadFile "https://prdownloads.sourceforge.net/libpng/zlib${env:ZLIB_VER}-dll.zip" -FileName zlib-dll.zip
7z x zlib-dll.zip -oC:\zlib-dll
}
$env:NMAKE_EXTRA="OPENSSL_DEF=/DENABLE_OPENSSL ZLIB_DEF=/DENABLE_ZLIB ${env:NMAKE_EXTRA}"
}
- ps: $env:VSCOMNTOOLS=(Get-Content ("env:VS" + "$env:VSVER" + "0COMNTOOLS"))
- echo "Using Visual Studio %VSVER%.0 at %VSCOMNTOOLS%"
- call "%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %VCVARS_PLATFORM%
- ps: >-
If(!(Test-Path -Path "C:\OpenSSL-${env:OPENSSL_PF}" )) {
Start-FileDownload https://slproweb.com/download/${env:OPENSSL_PF}OpenSSL-${env:OPENSSL_VER}.exe -FileName C:\WinOpenSSL.exe
C:\WinOpenSSL.exe /SILENT /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
}
- ps: >-
If(!(Test-Path -Path "C:\zlib-dll" )) {
appveyor DownloadFile "https://prdownloads.sourceforge.net/libpng/zlib${env:ZLIB_VER}-dll.zip" -FileName zlib-dll.zip
7z x zlib-dll.zip -oC:\zlib-dll
}
- appveyor DownloadFile "http://download.microsoft.com/download/2/C/9/2C93059C-0532-42DF-8C24-9AEAFF00768E/cngsdk.msi"
- cngsdk.msi /quiet
- uname -a
@ -62,8 +77,8 @@ build_script:
# disable features to speed up the script
- bash -c "exec 0</dev/null && ./configure --disable-openssl --disable-readline --disable-zlib || cat config.log"
- cp win32/winconfig.h config.h
- nmake /f Makefile.mak %NMAKE_ARCH% %NMAKE_DEBUG%
- cd win32 && nmake /f Makefile.mak %NMAKE_ARCH% %NMAKE_DEBUG% VSVER=%VSVER% OpenSC.msi
- nmake /f Makefile.mak %NMAKE_ARCH% %NMAKE_EXTRA%
- cd win32 && nmake /f Makefile.mak %NMAKE_ARCH% %NMAKE_EXTRA% VSVER=%VSVER% OpenSC.msi
- move OpenSC.msi %ARTIFACT%
- appveyor PushArtifact %ARTIFACT%

View File

@ -23,9 +23,8 @@ SM_DEF = /DENABLE_SM
# - uncomment the line starting with OPENSSL_DEF
# - set the OPENSSL_INCL_DIR below to your openssl include directory, preceded by "/I"
# - set the OPENSSL_LIB below to your openssl lib file
OPENSSL_DEF = /DENABLE_OPENSSL
#OPENSSL_DEF= /DENABLE_OPENSSL
!IF "$(OPENSSL_DEF)" == "/DENABLE_OPENSSL"
CANDLEFLAGS = -dOpenSSL $(CANDLEFLAGS)
!IF "$(BUILD_FOR)" == "WIN64"
OPENSSL_DIR = C:\OpenSSL-Win64
!ELSE
@ -49,7 +48,8 @@ OPENSSL_LIB = $(OPENSSL_DIR)\lib\VC\$(OPENSSL_STATIC_DIR)\libeay32MT.lib user32.
PROGRAMS_OPENSSL = cryptoflex-tool.exe pkcs15-init.exe netkey-tool.exe piv-tool.exe \
westcos-tool.exe sc-hsm-tool.exe dnie-tool.exe
OPENSC_FEATURES = $(OPENSC_FEATURES) openssl
CANDLEFLAGS = -dOpenSSL $(CANDLEFLAGS)
!ELSE
CANDLEFLAG_LIGHT = -dLight
!ENDIF
@ -58,7 +58,7 @@ CANDLEFLAGS = -dOpenSSL $(CANDLEFLAGS)
# - uncomment the line starting with ZLIB_DEF
# - set the ZLIB_INCL_DIR below to the zlib include lib proceeded by "/I"
# - set the ZLIB_LIB below to your zlib lib file
ZLIB_DEF = /DENABLE_ZLIB
#ZLIB_DEF = /DENABLE_ZLIB
!IF "$(ZLIB_DEF)" == "/DENABLE_ZLIB"
ZLIB_INCL_DIR = /IC:\zlib-dll\include
ZLIB_LIB = C:\zlib-dll\lib\zdll.lib
@ -90,11 +90,11 @@ COPTS = /W3 /D_CRT_SECURE_NO_DEPRECATE /MT /nologo /DHAVE_CONFIG_H $(ALL_INCLUD
!IF "$(BUILD_FOR)" == "WIN64"
LINKFLAGS = /NOLOGO /INCREMENTAL:NO /MACHINE:X64 /MANIFEST:NO /NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:MSVCRT $(LINKDEBUGFLAGS)
LIBFLAGS = /nologo /machine:x64
CANDLEFLAGS = -dPlatform=x64 $(CANDLEFLAGS)
CANDLEFLAGS = -dPlatform=x64 $(CANDLEFLAG_LIGHT)
!ELSE
LINKFLAGS = /NOLOGO /INCREMENTAL:NO /MACHINE:X86 /MANIFEST:NO /NODEFAULTLIB:MSVCRTD /NODEFAULTLIB:MSVCRT $(LINKDEBUGFLAGS)
LIBFLAGS = /nologo /machine:x86
CANDLEFLAGS = -dPlatform=x86 $(CANDLEFLAGS)
CANDLEFLAGS = -dPlatform=x86 $(CANDLEFLAG_LIGHT)
!ENDIF
.c.obj::
cl $(CODE_OPTIMIZATION) $(COPTS) /c $<

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="windows-1252"?>
<?if $(var.Platform) = x64 ?>
<?ifdef OpenSSL ?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@ (64bit)" ?>
<?else ?>
<?ifdef Light ?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@ Light (64bit)" ?>
<?else ?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@ (64bit)" ?>
<?endif ?>
<?define Win64YesNo="yes" ?>
<?define PlatformProgramFilesFolder = "ProgramFiles64Folder" ?>
<?define PlatformSystemFolder = "System64Folder" ?>
<?define PlatformUpgradeCode = "{9A449570-69A2-11E0-9CC6-955B4824019B}" ?>
<?else ?>
<?ifdef OpenSSL ?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@" ?>
<?else ?>
<?ifdef Light ?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@ Light" ?>
<?else ?>
<?define ProductName = "@OPENSC_VS_FF_PRODUCT_NAME@" ?>
<?endif ?>
<?define Win64YesNo="no" ?>
<?define PlatformProgramFilesFolder = "ProgramFilesFolder" ?>
@ -119,9 +119,6 @@
<Component Id="opensc.dll" Guid="*" Win64="$(var.Win64YesNo)">
<File Source="$(var.SOURCE_DIR)\src\libopensc\opensc.dll" Vital="yes"/>
</Component>
<Component Id="smm_local.dll" Guid="*" Win64="$(var.Win64YesNo)">
<File Source="$(var.SOURCE_DIR)\src\smm\smm-local.dll" Vital="yes"/>
</Component>
<Component Id="opensc_explorer.exe" Guid="*" Win64="$(var.Win64YesNo)">
<File Source="$(var.SOURCE_DIR)\src\tools\opensc-explorer.exe" Vital="yes"/>
</Component>
@ -149,7 +146,10 @@
<Component Id="iasecc_tool.exe" Guid="*" Win64="$(var.Win64YesNo)">
<File Source="$(var.SOURCE_DIR)\src\tools\iasecc-tool.exe" Vital="yes"/>
</Component>
<?ifdef OpenSSL ?>
<?ifndef Light ?>
<Component Id="smm_local.dll" Guid="*" Win64="$(var.Win64YesNo)">
<File Source="$(var.SOURCE_DIR)\src\smm\smm-local.dll" Vital="yes"/>
</Component>
<Component Id="cryptoflex_tool.exe" Guid="*" Win64="$(var.Win64YesNo)">
<File Source="$(var.SOURCE_DIR)\src\tools\cryptoflex-tool.exe" Vital="yes"/>
</Component>
@ -173,7 +173,7 @@
</Component>
<?endif ?>
</Directory>
<?ifdef OpenSSL ?>
<?ifndef Light ?>
<Directory Id="INSTALLDIR_PROFILES" Name="profiles">
<Component Id="cyberflex.profile" Guid="*" Win64="$(var.Win64YesNo)">
<File Source="$(var.SOURCE_DIR)\src\pkcs15init\cyberflex.profile"/>
@ -285,7 +285,9 @@
<Feature Id="OpenSC_core" Level="1" Title="OpenSC core library" Description="Core DLL and configuration file used by all other components." Absent="disallow">
<ComponentRef Id="opensc.dll"/>
<ComponentRef Id="opensc.conf"/>
<ComponentRef Id="smm_local.dll"/>
<?ifndef Light ?>
<ComponentRef Id="smm_local.dll"/>
<?endif ?>
</Feature>
<Feature Id="OpenSC_pkcs11" Level="1" Title="OpenSC PKCS#11 module" Description="PKCS#11 module usd by most open source and cross-platform software (like Firefox, Putty, TrueCrypt, OpenVPN etc)" TypicalDefault="install">
<ComponentRef Id="opensc_pkcs11.dll"/>
@ -309,7 +311,7 @@
<ComponentRef Id="pkcs15_crypt.exe"/>
<ComponentRef Id="openpgp_tool.exe"/>
<ComponentRef Id="iasecc_tool.exe"/>
<?ifdef OpenSSL ?>
<?ifndef Light ?>
<ComponentRef Id="cryptoflex_tool.exe"/>
<ComponentRef Id="pkcs15_init.exe"/>
<ComponentRef Id="netkey_tool.exe"/>