Merge branch 'master' of github.com:cascremers/scyther

This commit is contained in:
Cas Cremers 2023-02-12 21:49:50 +01:00
commit 9099cba8a8
4 changed files with 38 additions and 7 deletions

View File

@ -45,7 +45,7 @@ If you are using Ubuntu, installing these may be as simple as running
In case you also want to be able to compile Windows binaries from Linux, In case you also want to be able to compile Windows binaries from Linux,
you also need: you also need:
* `mingw32` * `i686-w64-mingw32`
Note that welcome all contributions, e.g., further protocol models. Just send Note that welcome all contributions, e.g., further protocol models. Just send
us a pull request. us a pull request.

View File

@ -89,6 +89,9 @@ def getCacheDir():
# If not none, append special name # If not none, append special name
if tmpdir != None: if tmpdir != None:
tmpdir = os.path.join(tmpdir,"Scyther-cache") tmpdir = os.path.join(tmpdir,"Scyther-cache")
# Normalize the tmpdir path.
tmpdir = os.path.normpath(tmpdir)
return tmpdir return tmpdir
@ -398,8 +401,14 @@ class Scyther(object):
# Generate temporary files for the output. # Generate temporary files for the output.
(fde,fne) = tempfile.mkstemp() # errors (fde,fne) = tempfile.mkstemp() # errors
(fdo,fno) = tempfile.mkstemp() # output (fdo,fno) = tempfile.mkstemp() # output
# Normalize the temporary paths.
fne = os.path.normpath(fne)
fno = os.path.normpath(fno)
if spdl: if spdl:
(fdi,fni) = tempfile.mkstemp() # input (fdi,fni) = tempfile.mkstemp() # input
fni = os.path.normpath(fni)
# Write (input) file # Write (input) file
fhi = os.fdopen(fdi,'w+') fhi = os.fdopen(fdi,'w+')
@ -409,14 +418,14 @@ class Scyther(object):
# Generate command line for the Scyther process # Generate command line for the Scyther process
self.cmd = "" self.cmd = ""
self.cmd += "\"%s\"" % self.program self.cmd += "\"%s\"" % self.program
self.cmd += " --append-errors=%s" % fne self.cmd += " --append-errors=\"%s\"" % fne
self.cmd += " --append-output=%s" % fno self.cmd += " --append-output=\"%s\"" % fno
self.cmd += " %s" % args self.cmd += " %s" % args
if spdl: if spdl:
self.cmd += " %s" % fni self.cmd += " \"%s\"" % fni
# Only for debugging, really # Only for debugging, really
##print self.cmd # print( self.cmd )
# Start the process # Start the process
safeCommand(self.cmd, storePopen=storePopen) safeCommand(self.cmd, storePopen=storePopen)

22
src/Build-Win32.cmake Normal file
View File

@ -0,0 +1,22 @@
################################################################
# Name: BuildUnix-Win32.cmake
# Purpose: Build Win32 binary on Unix
# Author: Cas Cremers
################################################################
message (STATUS "Building W32 version")
# This should work on win32 platform, but also when the compiler
# is available anyway under linux
set (CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
set (CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # to get rid of -rdynamic
# Signal for windows
set (CMAKE_C_FLAGS "-DFORWINDOWS")
# Static where possible (i.e. only not on the APPLE)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static -m32")
set (scythername "scyther-w32.exe")
add_executable (${scythername} ${Scyther_sources})

View File

@ -8,8 +8,8 @@ message (STATUS "Building W32 version")
# This should work on win32 platform, but also when the compiler # This should work on win32 platform, but also when the compiler
# is available anyway under linux # is available anyway under linux
set (CMAKE_C_COMPILER "i586-mingw32msvc-gcc") set (CMAKE_C_COMPILER "i686-w64-mingw32-gcc")
set (CMAKE_CXX_COMPILER "i586-mingw32msvc-g++") set (CMAKE_CXX_COMPILER "i686-w64-mingw32-g++")
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # to get rid of -rdynamic set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) # to get rid of -rdynamic
# Signal for windows # Signal for windows
set (CMAKE_C_FLAGS "-DFORWINDOWS") set (CMAKE_C_FLAGS "-DFORWINDOWS")