Skip to content

Commit

Permalink
Remove zlib headers form build under Linux,*BSD and macOS.
Browse files Browse the repository at this point in the history
Remove zlib headers form build under Linux,*BSD,macOS. Update README.md
  • Loading branch information
tx00100xt committed Dec 10, 2023
1 parent f7697fb commit 7540a2e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 8 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ License
* Serious Engine is licensed under the GNU GPL v2 (see LICENSE file).
* amp11lib is licensed under the GNU GPL v2 (see amp11lib/COPYING file).

### Note:
The following applies only to the for Windows build. Because none of the following is used when building under (Linux, *BSD, macOS) systems.
Some of the code included with the engine sources is not licensed under the GNU GPL v2:

* zlib (located in `Sources/Engine/zlib`) by Jean-loup Gailly and Mark Adler
Expand Down
2 changes: 2 additions & 0 deletions SamTFE/Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ if(USE_SYSTEM_ZLIB)
else()
message(FATAL_ERROR "Error! USE_SYSTEM_ZLIB is set but neccessary developer files are missing")
endif()
else()
add_definitions(-DSE1_ZLIB=1)
endif()

option(USE_ASM "Use ASM code" TRUE)
Expand Down
4 changes: 4 additions & 0 deletions SamTFE/Sources/Engine/Base/Unzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
typedef unsigned char Byte; // !!! FIXME: not sure why I suddenly needed this typedef here.
#endif

#ifdef PLATFORM_UNIX && !SE1_ZLIB
#include <zlib.h>
#else
#include <Engine/zlib/zlib.h>
#endif
extern CTCriticalSection zip_csLock; // critical section for access to zlib functions

#pragma pack(1)
Expand Down
5 changes: 5 additions & 0 deletions SamTFE/Sources/Engine/Network/Compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <Engine/Base/Stream.h>
#include <Engine/Network/Compression.h>
#include <Engine/Base/Synchronization.h>

#ifdef PLATFORM_UNIX && !SE1_ZLIB
#include <zlib.h>
#else
#include <Engine/zlib/zlib.h>
#endif

extern CTCriticalSection zip_csLock; // critical section for access to zlib functions

Expand Down
18 changes: 10 additions & 8 deletions SamTSE/Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ if(USE_SYSTEM_ZLIB)
else()
message(FATAL_ERROR "Error! USE_SYSTEM_ZLIB is set but neccessary developer files are missing")
endif()
else()
add_definitions(-DSE1_ZLIB=1)
endif()

option(USE_ASM "Use ASM code" TRUE)
if (USE_ASM)
MESSAGE(STATUS "Using assembler code (when available)")
else()
add_definitions(-DUSE_PORTABLE_C=1)
MESSAGE(STATUS "Using portable C instead of all ASM")
endif()

################################################################
Expand Down Expand Up @@ -107,14 +117,6 @@ else()
message(STATUS "Building Serious Sam Classic The Second Encounter")
endif()

option(USE_ASM "Use ASM code" TRUE)
if (USE_ASM)
MESSAGE(STATUS "Using assembler code (when available)")
else()
add_definitions(-DUSE_PORTABLE_C=1)
MESSAGE(STATUS "Using portable C instead of all ASM")
endif()

###############################################################
###############################################################
###############################################################
Expand Down
4 changes: 4 additions & 0 deletions SamTSE/Sources/Engine/Base/Unzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,
typedef unsigned char Byte; // !!! FIXME: not sure why I suddenly needed this typedef here.
#endif

#ifdef PLATFORM_UNIX && !SE1_ZLIB
#include <zlib.h>
#else
#include <Engine/zlib/zlib.h>
#endif
extern CTCriticalSection zip_csLock; // critical section for access to zlib functions

#pragma pack(1)
Expand Down
5 changes: 5 additions & 0 deletions SamTSE/Sources/Engine/Network/Compression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <Engine/Base/Stream.h>
#include <Engine/Network/Compression.h>
#include <Engine/Base/Synchronization.h>

#ifdef PLATFORM_UNIX && !SE1_ZLIB
#include <zlib.h>
#else
#include <Engine/zlib/zlib.h>
#endif

extern CTCriticalSection zip_csLock; // critical section for access to zlib functions

Expand Down

0 comments on commit 7540a2e

Please sign in to comment.