forked from diasurgical/devilutionX
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows 9x MinGW build (diasurgical#6619)
- Loading branch information
Showing
11 changed files
with
348 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#SET(MINGW_CROSS TRUE) | ||
|
||
SET(CROSS_PREFIX "/usr" CACHE STRING "crosstool-NG prefix") | ||
|
||
SET(CMAKE_SYSTEM_NAME Windows) | ||
|
||
# workaround | ||
list(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${CROSS_PREFIX}/i686-w64-mingw32/include") | ||
|
||
list(PREPEND CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/mingw9x/include") | ||
list(PREPEND CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/mingw9x/include") | ||
|
||
SET(CMAKE_C_COMPILER "i686-w64-mingw32-gcc") | ||
SET(CMAKE_CXX_COMPILER "i686-w64-mingw32-g++") | ||
set(CMAKE_RC_COMPILER "i686-w64-mingw32-windres") | ||
set(PKG_CONFIG_EXECUTABLE "${CROSS_PREFIX}/bin/i686-w64-mingw32-pkg-config" CACHE STRING "Path to pkg-config") | ||
|
||
SET(CMAKE_FIND_ROOT_PATH "${CROSS_PREFIX}/i686-w64-mingw32" "${CROSS_PREFIX}/i686-w64-mingw32/i686-w64-mingw32") | ||
|
||
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
|
||
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) | ||
|
||
#set(WIN32_INSTALL_DLLS "${CROSS_PREFIX}/i686-w64-mingw32/bin/SDL.dll") | ||
#set(SDL1_EXEC_PREFIX "${CROSS_PREFIX}/i686-w64-mingw32") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#ifndef _WINDEF_OVERRIDE_ | ||
#define _WINDEF_OVERRIDE_ | ||
|
||
#include_next <windef.h> | ||
|
||
// MinGW does not define these when _WIN32_WINNT < 0x0400 | ||
// but it declares functions that use it unconditionally. | ||
typedef enum _FINDEX_INFO_LEVELS { | ||
FindExInfoStandard, | ||
FindExInfoBasic, | ||
FindExInfoMaxInfoLevel | ||
} FINDEX_INFO_LEVELS; | ||
typedef enum _FINDEX_SEARCH_OPS { | ||
FindExSearchNameMatch, | ||
FindExSearchLimitToDirectories, | ||
FindExSearchLimitToDevices, | ||
FindExSearchMaxSearchOp | ||
} FINDEX_SEARCH_OPS; | ||
|
||
typedef void* SOLE_AUTHENTICATION_SERVICE; | ||
|
||
#endif /* _WINDEF_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
set(ASAN OFF) | ||
set(UBSAN OFF) | ||
|
||
#set(NONET ON) | ||
set(USE_SDL1 ON) | ||
#set(DEVILUTIONX_SYSTEM_BZIP2 OFF) | ||
#set(DEVILUTIONX_SYSTEM_LIBFMT OFF) | ||
#set(DEVILUTIONX_STATIC_LIBSODIUM OFF) | ||
|
||
# Compatibility with Windows 9x 8-bit mode and improved performance | ||
set(SDL1_VIDEO_MODE_BPP 8) | ||
#set(SDL1_FORCE_DIRECT_RENDER ON) | ||
|
||
#set(DEVILUTIONX_WINDOWS_NO_WCHAR ON) | ||
|
||
# `WINVER=0x0500` without `_WIN32_WINNT` is Windows 98. | ||
# MinGW force-defines `_WIN32_WINNT=0xa00` if it isn't defined, so define it as 0. | ||
#add_definitions(-DWINVER=0x0500 -D_WIN32_WINDOWS=0x0500 -D_WIN32_WINNT=0) | ||
set(WINVER 0x0500) | ||
set(_WIN32_WINNT 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
|
||
SDLDEV_VERS=1.2.15 | ||
SODIUM_VERS=1.0.18 | ||
|
||
# exit when any command fails | ||
set -euo pipefail | ||
|
||
MINGW_ARCH=i686-w64-mingw32 | ||
SODIUM_ARCH=win32 | ||
|
||
# set MINGW_PREFIX | ||
MINGW_PREFIX=/usr/${MINGW_ARCH} | ||
if [ ! -d "${MINGW_PREFIX}" ]; then | ||
echo "MinGW prefix not found (${MINGW_PREFIX})" | ||
exit 1 | ||
else | ||
echo "Installing to ${MINGW_PREFIX}" | ||
fi | ||
|
||
# only use sudo when necessary | ||
if [ `id -u` -ne 0 ]; then | ||
SUDO=sudo | ||
else | ||
SUDO="" | ||
fi | ||
|
||
rm -rf tmp-mingw9x-prep | ||
mkdir -p tmp-mingw9x-prep | ||
cd tmp-mingw9x-prep | ||
|
||
curl --no-progress-meter -OL https://www.libsdl.org/release/SDL-devel-${SDLDEV_VERS}-mingw32.tar.gz | ||
tar -xzf SDL-devel-${SDLDEV_VERS}-mingw32.tar.gz | ||
$SUDO cp -r SDL-*/include/* ${MINGW_PREFIX}/include | ||
$SUDO cp -r SDL-*/lib/* ${MINGW_PREFIX}/lib | ||
$SUDO cp -r SDL-*/bin/* ${MINGW_PREFIX}/bin | ||
|
||
wget -q https://github.com/jedisct1/libsodium/releases/download/${SODIUM_VERS}-RELEASE/libsodium-${SODIUM_VERS}-mingw.tar.gz -Olibsodium-${SODIUM_VERS}-mingw.tar.gz | ||
tar -xzf libsodium-${SODIUM_VERS}-mingw.tar.gz --no-same-owner | ||
$SUDO cp -r libsodium-${SODIUM_ARCH}/* ${MINGW_PREFIX} | ||
|
||
# Fixup pkgconfig prefix: | ||
find "${MINGW_PREFIX}/lib/pkgconfig/" -name '*.pc' -exec \ | ||
$SUDO sed -i "s|^prefix=.*|prefix=${MINGW_PREFIX}|" '{}' \; | ||
|
||
# Fixup CMake prefix: | ||
find "${MINGW_PREFIX}" -name '*.cmake' -exec \ | ||
$SUDO sed -i "s|/opt/local/${MINGW_ARCH}|${MINGW_PREFIX}|" '{}' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.