Issue #123: Make Engine 3.2 compile on Windows. Work mostly by Alex Sualdea.

pull/124/head
Jörg Knobloch 2 months ago
parent b4093f78e5
commit 6fca3ba4a3

@ -13,8 +13,8 @@ SET YML2PROC="%yml2_directory%\yml2proc"
:: Create the system.db
PUSHD %engine_directory%\db
CALL make_systemdb
IF NOT EXIST "%ProgramData%\pEp" "MKDIR %ProgramData%\pEp"
DEL "%ProgramData%\pEp\system.db"
IF NOT EXIST "%ProgramData%\pEp" MKDIR "%ProgramData%\pEp"
DEL /F /Q "%ProgramData%\pEp\system.db"
MOVE system.db "%ProgramData%\pEp\system.db"
:: Generate code in ...\pEpEngine\codegen
@ -59,6 +59,10 @@ ECHO PY %YML2PROC% -E utf-8 -y gen_statemachine.ysl2 sync.fsm
PY %YML2PROC% -E utf-8 -y gen_statemachine.ysl2 sync.fsm
IF %ERRORLEVEL% NEQ 0 GOTO end
ECHO PY %YML2PROC% -E utf-8 -y gen_messages.ysl2 storage.fsm
PY %YML2PROC% -E utf-8 -y gen_messages.ysl2 storage.fsm
IF %ERRORLEVEL% NEQ 0 GOTO end
XCOPY /y generated\*.asn1 ..\asn.1\
XCOPY /y generated\*.c ..\src\
XCOPY /y generated\*.h ..\src\
@ -68,21 +72,21 @@ CD %engine_directory%\asn.1
DEL *.h
DEL *.c
..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1
type nul >> "Sync.c"
IF %ERRORLEVEL% NEQ 0 GOTO end
rem DISTRIBUTION = distribution keyreset managedgroup exploration echo
rem SYNC = sync keysync trustsync groupsync
rem STORAGE = storage messagestorage
..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1
type nul >> "Distribution.c"
..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 sync.asn1 keysync.asn1 trustsync.asn1 groupsync.asn1 distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 echo.asn1
IF %ERRORLEVEL% NEQ 0 GOTO end
type nul >> "Sync.c"
..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 storage.asn1 messagestorage.asn1
type nul >> "Storage.c"
..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 distribution.asn1 keyreset.asn1 managedgroup.asn1 exploration.asn1 echo.asn1
IF %ERRORLEVEL% NEQ 0 GOTO end
type nul >> "Distribution.c"
..\..\Tools\asn1c\bin\asn1c -S ../../Tools/asn1c/share/asn1c -gen-PER -fincludes-quoted -fcompound-names -pdu=auto pEp.asn1 message.asn1
type nul >> "ASN1Message.c"
IF %ERRORLEVEL% NEQ 0 GOTO end
type nul >> "ASN1Message.c"
DEL *-sample.c

@ -72,25 +72,24 @@
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PEPENGINE_EXPORTS;_CRT_SECURE_NO_WARNINGS;USE_SEQUOIA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<EnablePREfast>false</EnablePREfast>
<AdditionalIncludeDirectories>$(SolutionDir)pEpEngine\asn.1;$(SolutionDir);$(SolutionDir)libetpan\build-windows\include;$(SolutionDir)Tools\asn1c\share\asn1c;$(SolutionDir)sequoia\openpgp-ffi\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)pEpEngine\asn.1;$(SolutionDir);$(SolutionDir)libetpan\build-windows\include;$(SolutionDir)Tools\asn1c\share\asn1c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>Default</CompileAs>
<DisableSpecificWarnings>4703</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>sequoia_openpgp_ffi.lib;gmp.lib;nettle.lib;hogweed.lib;ws2_32.lib;userenv.lib;dbghelp.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>Shlwapi.lib; pep_engine_sequoia_backend.dll.lib;gmp.lib;nettle.lib;hogweed.lib;ws2_32.lib;userenv.lib;dbghelp.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>NotSet</ShowProgress>
<AdditionalLibraryDirectories>$(SolutionDir)sequoia\target\debug;C:\msys64\mingw32\lib</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SolutionDir)pEpEngineSequoiaBackend\target\debug;C:\msys64\mingw32\lib</AdditionalLibraryDirectories>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<SuppressStartupBanner>false</SuppressStartupBanner>
</Link>
<PreBuildEvent>
<Command>PUSHD $(SolutionDir)sequoia &amp;&amp; cargo build &amp;&amp; POPD</Command>
<Command>PUSHD $(SolutionDir)pEpEngineSequoiaBackend &amp;&amp; set NETTLE_HAVE_CV448=yes&amp;&amp; cargo build &amp;&amp; POPD </Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)sequoia\target\debug\sequoia_openpgp_ffi.dll" "$(TargetDir)" /Y</Command>
<Command>xcopy "$(SolutionDir)sequoia\target\debug\sq.exe" "$(TargetDir)" /Y</Command>
<Command>xcopy "$(SolutionDir)pEpEngineSequoiaBackend\target\debug\pep_engine_sequoia_backend.dll" "$(TargetDir)" /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@ -103,7 +102,7 @@
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PEPENGINE_EXPORTS;USE_SEQUOIA;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>false</SDLCheck>
<TreatWarningAsError>false</TreatWarningAsError>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)libetpan\build-windows\include;$(SolutionDir)Tools\asn1c\share\asn1c;$(SolutionDir)sequoia\openpgp-ffi\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir);$(SolutionDir)libetpan\build-windows\include;$(SolutionDir)Tools\asn1c\share\asn1c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<CompileAs>Default</CompileAs>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ControlFlowGuard>Guard</ControlFlowGuard>
@ -115,15 +114,14 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>sequoia_openpgp_ffi.lib;gmp.lib;nettle.lib;hogweed.lib;ws2_32.lib;userenv.lib;dbghelp.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)sequoia\target\release;C:\msys64\mingw32\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>Shlwapi.lib;pep_engine_sequoia_backend.dll.lib;gmp.lib;nettle.lib;hogweed.lib;ws2_32.lib;userenv.lib;dbghelp.lib;Rpcrt4.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)pEpEngineSequoiaBackend\target\release;C:\msys64\mingw32\lib</AdditionalLibraryDirectories>
</Link>
<PreBuildEvent>
<Command>PUSHD $(SolutionDir)sequoia &amp;&amp; cargo build --release &amp;&amp; POPD</Command>
<Command>PUSHD $(SolutionDir)pEpEngineSequoiaBackend &amp;&amp; set NETTLE_HAVE_CV448=yes&amp;&amp; cargo build --release &amp;&amp; POPD </Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>xcopy "$(SolutionDir)sequoia\target\release\sequoia_openpgp_ffi.dll" "$(TargetDir)" /Y</Command>
<Command>xcopy "$(SolutionDir)sequoia\target\release\sq.exe" "$(TargetDir)" /Y</Command>
<Command>xcopy "$(SolutionDir)pEpEngineSequoiaBackend\target\release\pep_engine_sequoia_backend.dll" "$(TargetDir)" /Y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
@ -132,6 +130,7 @@
<ClCompile Include="..\src\bloblist.c" />
<ClCompile Include="..\src\cryptotech.c" />
<ClCompile Include="..\src\distribution_codec.c" />
<ClCompile Include="..\src\echo_api.c" />
<ClCompile Include="..\src\email.c" />
<ClCompile Include="..\src\engine_sql.c" />
<ClCompile Include="..\src\etpan_mime.c" />
@ -146,18 +145,23 @@
<ClCompile Include="..\src\key_reset.c" />
<ClCompile Include="..\src\labeled_int_list.c" />
<ClCompile Include="..\src\map_asn1.c" />
<ClCompile Include="..\src\media_key.c" />
<ClCompile Include="..\src\message.c" />
<ClCompile Include="..\src\message_api.c" />
<ClCompile Include="..\src\message_codec.c" />
<ClCompile Include="..\src\mime.c" />
<ClCompile Include="..\src\openpgp_compat.c" />
<ClCompile Include="..\src\pEpEngine.c" />
<ClCompile Include="..\src\pEp_log.c" />
<ClCompile Include="..\src\pEp_debug.c" />
<ClCompile Include="..\src\pEp_rmd160.c" />
<ClCompile Include="..\src\pEp_string.c" />
<ClCompile Include="..\src\pgp_sequoia.c" />
<ClCompile Include="..\src\platform_windows.cpp" />
<ClCompile Include="..\src\resource_id.c" />
<ClCompile Include="..\src\security_checks.c" />
<ClCompile Include="..\src\sqlite3.c" />
<ClCompile Include="..\src\sql_reliability.c" />
<ClCompile Include="..\src\stringlist.c" />
<ClCompile Include="..\src\stringpair.c" />
<ClCompile Include="..\src\Sync_actions.c" />
@ -207,6 +211,8 @@
<ClInclude Include="..\src\pEpEngine.h" />
<ClInclude Include="..\src\pEpEngine_internal.h" />
<ClInclude Include="..\src\pEp_internal.h" />
<ClInclude Include="..\src\pEp_log.h" />
<ClInclude Include="..\src\pEp_rmd160.h" />
<ClInclude Include="..\src\pEp_string.h" />
<ClInclude Include="..\src\pgp_sequoia.h" />
<ClInclude Include="..\src\pgp_sequoia_internal.h" />

@ -144,6 +144,18 @@
<ClCompile Include="..\src\message_codec.c">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="..\src\pEp_log.c">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="..\src\echo_api.c">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="..\src\media_key.c">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="..\src\pEp_rmd160.c">
<Filter>Quelldateien</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\src\keymanagement.h">
@ -329,6 +341,12 @@
<ClInclude Include="..\src\TrustSync_fsm.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\src\pEp_log.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="..\src\pEp_rmd160.h">
<Filter>Headerdateien</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Text Include="..\LICENSE.txt" />

@ -305,6 +305,9 @@ void uuid_unparse_upper(pEpUUID uu, uuid_string_t out);
typedef DWORD _pEp_pid_t;
_pEp_pid_t getpid(void);
typedef DWORD pid_t;
pid_t getpid(void);
#ifndef __cplusplus
#define inline __inline
#endif

Loading…
Cancel
Save