MXE: Upgrade toolchain

Switch to Fluidlite because latest Glib versions dropped Windows XP
support and Fluidsynth needs Glib.
This commit is contained in:
Le Philousophe
2024-06-30 18:39:31 +00:00
parent a503ea9b32
commit d21303bb40
19 changed files with 141 additions and 244 deletions
+9 -3
View File
@@ -57,6 +57,7 @@ discord_rpc_check = {
'prefix': 'v',
}
libiconv_check = {
'check': 'git tag',
'repository': 'https://git.savannah.gnu.org/git/libiconv.git',
@@ -320,9 +321,9 @@ VERSIONS = {
('./toolchains/miyoo/packages/toolchain/build.sh', 'BUILDROOT'): 'ignore',
('./toolchains/mxe/Dockerfile.m4', 'MXE'): {
'check': 'git tag',
'check': 'git commit',
'repository': 'https://github.com/mxe/mxe.git',
'pattern': '^build-',
'branch': 'master',
},
('./toolchains/mxe/packages/discord-rpc/discord-rpc.mk', ''): discord_rpc_check,
('./toolchains/mxe/packages/discord-rpc/rapidjson.mk', ''): {
@@ -332,7 +333,12 @@ VERSIONS = {
'exclude pattern': r'.*-beta$',
},
# This is the system version so no need to check
('./toolchains/mxe/packages/lld/lld.mk', ''): 'ignore',
('./toolchains/mxe/packages/fluidlite/fluidlite.mk', ''): {
'check': 'git commit',
'repository': 'https://github.com/divideconcept/FluidLite.git',
'branch': 'master',
'short': True,
},
('./toolchains/mxe/packages/retrowave/retrowave.mk', ''): retrowave_check,
('./toolchains/mxe/packages/winsparkle/winsparkle.mk', ''): {
'check': 'git tag',
+8 -7
View File
@@ -1,4 +1,4 @@
m4_define(`MXE_VERSION',build-2022-01-13)m4_dnl
m4_define(`MXE_VERSION',ae6c66957d6a5bb124358ef93ffc57976876a599)m4_dnl
m4_include(`paths.m4')m4_dnl
m4_include(`packages.m4')m4_dnl
@@ -30,6 +30,8 @@ RUN apt-get update && \
lzip \
p7zip-full \
python-is-python3 \
python3-mako \
python3-packaging \
ruby && \
rm -rf /var/lib/apt/lists/*
@@ -48,12 +50,11 @@ local_package(toolchain)
# That will install cmake configuration files as well
mxe_package(cmake)
# peldd will be used when creating package: only build native version
# Use a local version to have target wrapper scripts
local_mxe_package(pe-util)
# peldd will be used when creating package
mxe_package(pe-util)
# LLD links ScummVM faster
local_mxe_package(lld)
mxe_package(lld)
# Install everything through MXE to not mess with environment variables
# This lets MXE build all platforms and avoids to mess with its settings
@@ -97,9 +98,9 @@ mxe_package(libiconv)
local_mxe_package(sdl2)
local_mxe_package(sdl2_net)
mxe_package(sdl2_net)
local_mxe_package(fluidsynth-light)
local_mxe_package(fluidlite)
local_mxe_package(winsparkle)
@@ -21,7 +21,7 @@ endef
define $(PKG)_BUILD
cd '$(BUILD_DIR)' && $(SOURCE_DIR)/configure \
$(MXE_CONFIGURE_OPTS) \
--with-schannel \
--with-winssl \
--without-ssl \
--without-winidn \
--enable-sspi \
@@ -0,0 +1,51 @@
From 849751658e68ae734dcf493153d012da63c2652a Mon Sep 17 00:00:00 2001
From: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Fri, 5 May 2023 22:58:29 +0200
Subject: [PATCH] Fix static build
---
CMakeLists.txt | 3 ++-
include/{fluidlite.h => fluidlite.h.in} | 6 ++++++
2 files changed, 8 insertions(+), 1 deletion(-)
rename include/{fluidlite.h => fluidlite.h.in} (95%)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4aead6c..530651f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,10 +33,11 @@ include(CheckIncludeFile)
check_include_file(fcntl.h HAVE_FCNTL_H)
list(APPEND HEADERS
- include/fluidlite.h
+ ${PROJECT_BINARY_DIR}/fluidlite.h
)
configure_file(src/version.cmake ${PROJECT_BINARY_DIR}/fluidlite/version.h @ONLY)
+configure_file(include/fluidlite.h.in ${PROJECT_BINARY_DIR}/fluidlite.h)
list(APPEND SCOPED_HEADERS
include/fluidlite/types.h
diff --git a/include/fluidlite.h b/include/fluidlite.h.in
similarity index 95%
rename from include/fluidlite.h
rename to include/fluidlite.h.in
index a159ddd..5e6ea4b 100644
--- a/include/fluidlite.h
+++ b/include/fluidlite.h.in
@@ -27,6 +27,12 @@
extern "C" {
#endif
+#cmakedefine01 FLUIDLITE_BUILD_SHARED
+
+#if (FLUIDLITE_BUILD_SHARED == 0) && !defined(FLUIDLITE_STATIC)
+#define FLUIDLITE_STATIC
+#endif
+
#if defined(_WIN32)
#if defined(FLUIDLITE_STATIC)
#define FLUIDSYNTH_API
--
2.34.1
@@ -0,0 +1,16 @@
PKG := fluidlite
$(PKG)_WEBSITE := https://github.com/divideconcept/FluidLite
$(PKG)_DESCR := Fluidlite
$(PKG)_IGNORE :=
$(PKG)_VERSION := d59d232
$(PKG)_CHECKSUM := f119ff09fa7e3a87874eb51546de66ce50342bbefd9ab11e37f292a71b097c5e
$(PKG)_GH_CONF := divideconcept/FluidLite/branches/master
$(PKG)_DEPS := cc
define $(PKG)_BUILD
cd '$(BUILD_DIR)' && '$(TARGET)-cmake' '$(SOURCE_DIR)' \
-DFLUIDLITE_BUILD_SHARED=OFF \
$($(PKG)_CONFIGURE_OPTS)
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' VERBOSE=1
$(MAKE) -C '$(BUILD_DIR)' -j 1 install VERBOSE=1
endef
@@ -1,38 +0,0 @@
# This file is part of MXE. See LICENSE.md for licensing information.
PKG := fluidsynth-light
$(PKG)_WEBSITE := http://fluidsynth.org/
$(PKG)_DESCR := FluidSynth (with less deps)
$(PKG)_IGNORE = $(fluidsynth_IGNORE)
$(PKG)_VERSION = $(fluidsynth_VERSION)
$(PKG)_CHECKSUM = $(fluidsynth_CHECKSUM)
$(PKG)_GH_CONF := $(fluidsynth_GH_CONF)
$(PKG)_SUBDIR = $(fluidsynth_SUBDIR)
$(PKG)_FILE = $(fluidsynth_FILE)
$(PKG)_URL = $(fluidsynth_URL)
$(PKG)_DEPS := cc glib-light
$(PKG)_OO_DEPS += cmake-conf
# Use test file and patches provided by MXE
$(PKG)_TEST_FILE = $(fluidsynth_TEST_FILE)
$(PKG)_PATCHES = $(fluidsynth_PATCHES)
define $(PKG)_UPDATE
echo $(fluidsynth_VERSION)
endef
$(PKG)_BUILD = $(fluidsynth_BUILD)
$(PKG)_CONFIGURE_OPTS = -Denable-aufile=OFF -Denable-dbus=OFF \
-Denable-network=OFF -Denable-jack=OFF \
-Denable-ladspa=OFF -Denable-libinstpatch=OFF \
-Denable-libsndfile=OFF -Denable-midishare=OFF \
-Denable-opensles=OFF -Denable-oboe=OFF \
-Denable-oss=OFF -Denable-dsound=OFF \
-Denable-waveout=OFF -Denable-winmidi=OFF \
-Denable-sdl2=OFF -Denable-pulseaudio=OFF \
-Denable-readline=OFF
# Don't remove following comment: it's used to trigger automatic detection of cmake based packages
# We could manually add dependency but if it changes, we could expect that heuristic won't
# $(TARGET)-cmake
@@ -1,3 +0,0 @@
# Patch gettext dependency as we don't need host tools
gettext_DEPS = cc libiconv
@@ -1,37 +0,0 @@
# This file is part of MXE. See LICENSE.md for licensing information.
PKG := glib-light
$(PKG)_WEBSITE := https://gtk.org/
$(PKG)_DESCR := Minimal GLib (for FluidSynth only)
$(PKG)_IGNORE = $(glib_IGNORE)
$(PKG)_VERSION = $(glib_VERSION)
$(PKG)_CHECKSUM = $(glib_CHECKSUM)
$(PKG)_SUBDIR = $(glib_SUBDIR)
$(PKG)_FILE = $(glib_FILE)
$(PKG)_URL = $(glib_URL)
$(PKG)_DEPS := cc gettext libffi
# Use patches provided by MXE
$(PKG)_PATCHES = $(glib_PATCHES)
define $(PKG)_UPDATE
echo $(glib_VERSION)
endef
define $(PKG)_BUILD
# cross build
# Prevent autogen to override GTKDOCIZE which is used by autoreconf
sed -i -e 's/GTKDOCIZE/GTKDOCIZE_/' $(SOURCE_DIR)/autogen.sh
cd '$(SOURCE_DIR)' && NOCONFIGURE=true GTKDOCIZE=true ./autogen.sh
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
$(MXE_CONFIGURE_OPTS) \
--with-threads=win32 \
--with-pcre=internal \
CXX='$(TARGET)-g++' \
PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' \
CFLAGS='-Wno-incompatible-pointer-types -Wno-deprecated-declarations -Wno-format'
$(MAKE) -C '$(BUILD_DIR)/glib' -j '$(JOBS)' install sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(BUILD_DIR)/gthread' -j '$(JOBS)' install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS=
$(MAKE) -C '$(BUILD_DIR)' -j '$(JOBS)' install-pkgconfigDATA pkgconfig_DATA="glib-2.0.pc gthread-2.0.pc"
endef
-8
View File
@@ -1,8 +0,0 @@
PKG := lld
$(PKG)_WEBSITE := https://lld.llvm.org
$(PKG)_DESCR := LLD Linker
$(PKG)_VERSION := system
define $(PKG)_BUILD
ln -s /usr/bin/ld.lld '$(MXE_PREFIX_DIR)/bin/$(TARGET)-ld.lld'
endef
-17
View File
@@ -1,17 +0,0 @@
# Patch pe-util to not build target binary but still install wrapper scripts for native one
# newline variable is defined by MXE
PKG := pe-util
$(PKG)_DEPS := $(BUILD)~$(PKG)
define $(PKG)_BUILD
(echo '#!/bin/sh'; \
echo 'exec "$(PREFIX)/$(BUILD)/bin/peldd" \
--clear-path \
--path "$(PREFIX)/$(TARGET)/bin" \
--wlist uxtheme.dll \
--wlist opengl32.dll \
--wlist userenv.dll \
"$$@"') \
> '$(PREFIX)/bin/$(TARGET)-peldd'
chmod 0755 '$(PREFIX)/bin/$(TARGET)-peldd'
endef
@@ -1,8 +1,8 @@
diff --git a/configure.ac b/configure.ac
index b6783a08..28234207 100644
index 3dadf542c..071f4e0f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3889,7 +3889,7 @@ case "$host" in
@@ -4169,7 +4169,7 @@ case "$host" in
VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
@@ -1,26 +1,24 @@
diff -u a/configure.ac b/configure.ac
diff --git a/configure.ac b/configure.ac
index 071f4e0f3..646dd9554 100644
--- a/configure.ac
+++ b/configure.ac
@@ -230,27 +230,6 @@
@@ -250,24 +250,6 @@ if test x$enable_dependency_tracking = xyes; then
fi
fi
-AC_MSG_CHECKING(for linker option --no-undefined)
-have_no_undefined=no
-case "$host" in
- dnl Skip this on platforms where it is just simply busted.
-dnl Skip this on platforms where it is just simply busted.
- *-*-openbsd*)
- ;;
-
- *)
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,--no-undefined"
- AC_TRY_LINK([
- ],[
- ],[
- AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [
- have_no_undefined=yes
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,--no-undefined"
- ])
- BUILD_LDFLAGS="$BUILD_LDFLAGS -Wl,--no-undefined"
- ],[])
- LDFLAGS="$save_LDFLAGS"
- ;;
-esac
@@ -0,0 +1,22 @@
From ab671b54d34363297f449053b53a035fec960879 Mon Sep 17 00:00:00 2001
From: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Sun, 30 Jun 2024 16:15:18 +0200
Subject: [PATCH 3/3] PATCH4
diff --git a/sdl2-config.in b/sdl2-config.in
index f6eca7668..1fe584a39 100644
--- a/sdl2-config.in
+++ b/sdl2-config.in
@@ -1,7 +1,7 @@
#!/bin/sh
# Get the canonical path of the folder containing this script
-bindir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
+bindir=$(cd -P -- "$(dirname -- "$(readlink -e "$0")")" && printf '%s\n' "$(pwd -P)")
# Calculate the canonical path of the prefix, relative to the folder of this script
prefix=$(cd -P -- "$bindir/@bin_prefix_relpath@" && printf '%s\n' "$(pwd -P)")
--
2.44.2
@@ -1,80 +0,0 @@
From e2782ccaa642202e50aebefe4107e4313f6bbb53 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Sat, 17 Jul 2021 15:56:53 +0100
Subject: [PATCH] Include required libraries in pkg-config output
---
Makefile.in | 4 ++++
SDL2_net.pc.in | 4 +++-
configure | 23 +++++++++++++++++++++++
4 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 1e5292d..a80d9c2 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -305,6 +305,10 @@ ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
+ENABLE_SHARED_FALSE = @ENABLE_SHARED_FALSE@
+ENABLE_SHARED_TRUE = @ENABLE_SHARED_TRUE@
+ENABLE_STATIC_FALSE = @ENABLE_STATIC_FALSE@
+ENABLE_STATIC_TRUE = @ENABLE_STATIC_TRUE@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
diff --git a/SDL2_net.pc.in b/SDL2_net.pc.in
index e3ad892..28dd6c8 100644
--- a/SDL2_net.pc.in
+++ b/SDL2_net.pc.in
@@ -7,5 +7,7 @@ Name: SDL2_net
Description: net library for Simple DirectMedia Layer
Version: @VERSION@
Requires: sdl2 >= @SDL_VERSION@
-Libs: -L${libdir} -lSDL2_net
+@ENABLE_SHARED_TRUE@Libs: -L${libdir} -lSDL2_net
+@ENABLE_SHARED_TRUE@@ENABLE_STATIC_TRUE@Libs.private: @INETLIB@
+@ENABLE_SHARED_FALSE@Libs: -L${libdir} -lSDL2_net @INETLIB@
Cflags: -I${includedir}/SDL2
diff --git a/configure b/configure
index 9ec6045..eb4e374 100755
--- a/configure
+++ b/configure
@@ -772,6 +772,10 @@ ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
LIBOBJS
+ENABLE_STATIC_FALSE
+ENABLE_STATIC_TRUE
+ENABLE_SHARED_FALSE
+ENABLE_SHARED_TRUE
HAVE_GUI_LIB_FALSE
HAVE_GUI_LIB_TRUE
SDL2_CONFIG
@@ -16024,6 +16028,25 @@ fi
CXXFLAGS="$CXXFLAGS $CFLAGS"
+if test x$enable_shared = xyes; then
+ ENABLE_SHARED_TRUE=
+ ENABLE_SHARED_FALSE="#"
+else
+ ENABLE_SHARED_TRUE="#"
+ ENABLE_SHARED_FALSE=
+fi
+if test x$enable_static = xyes; then
+ ENABLE_STATIC_TRUE=
+ ENABLE_STATIC_FALSE="#"
+else
+ ENABLE_STATIC_TRUE="#"
+ ENABLE_STATIC_FALSE=
+fi
+
+
+
+
+
# Finally create all the generated files
@@ -1 +0,0 @@
# This file is a placeholder because MXE expects to find .mk files in the plugins folders
@@ -0,0 +1,20 @@
diff --git a/src/pe-util.mk b/src/pe-util.mk
index ad96670d..19580a65 100644
--- a/src/pe-util.mk
+++ b/src/pe-util.mk
@@ -20,7 +20,6 @@ endef
define $(PKG)_BUILD
# install prefixed wrapper with default paths
- $(if $(BUILD_SHARED),
(echo '#!/bin/sh'; \
echo 'exec "$(PREFIX)/$(BUILD)/bin/peldd" \
--clear-path \
@@ -32,7 +31,6 @@ define $(PKG)_BUILD
"$$@"') \
> '$(PREFIX)/bin/$(TARGET)-peldd'
chmod 0755 '$(PREFIX)/bin/$(TARGET)-peldd'
- )
endef
define $(PKG)_BUILD_$(BUILD)
@@ -1,29 +1,16 @@
commit 4eeec9367a85d390f49ebb109350ba4b90a1796c
commit ec4643254420bedfc38e85eb05273ab5dde878fc
Author: Le Philousophe <lephilousophe@users.noreply.github.com>
Date: Sun Oct 22 15:08:30 2023 +0200
Date: Sat Jun 29 13:06:03 2024 +0200
Fix GCC bug #54412
This patch comes from https://github.com/msys2/MINGW-packages/pull/10314
diff --git a/plugins/gcc11/gcc11-overlay.mk b/plugins/gcc11/gcc11-overlay.mk
index 1d0937f2..4dc7f3f8 100644
--- a/plugins/gcc11/gcc11-overlay.mk
+++ b/plugins/gcc11/gcc11-overlay.mk
@@ -32,7 +32,7 @@ $(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
$(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.xz
$(PKG)_URL := https://ftp.gnu.org/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_URL_2 := https://www.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
-$(PKG)_PATCHES := $(dir $(lastword $(MAKEFILE_LIST)))/gcc11.patch
+$(PKG)_PATCHES := $(dir $(lastword $(MAKEFILE_LIST)))/gcc11.patch $(dir $(lastword $(MAKEFILE_LIST)))/noalign.patch
$(PKG)_DEPS := binutils mingw-w64 $(addprefix $(BUILD)~,gmp isl mpc mpfr zstd)
_$(PKG)_CONFIGURE_OPTS = --with-zstd='$(PREFIX)/$(BUILD)'
diff --git a/plugins/gcc11/noalign.patch b/plugins/gcc11/noalign.patch
diff --git a/src/gcc-9999-noalign.patch b/src/gcc-9999-noalign.patch
new file mode 100644
index 00000000..94e550d7
--- /dev/null
+++ b/plugins/gcc11/noalign.patch
+++ b/src/gcc-9999-noalign.patch
@@ -0,0 +1,191 @@
+From e3aa1d42ac5bd582fd57f40c224f3c55fc20fd69 Mon Sep 17 00:00:00 2001
+From: Kai Tietz <ktietz@anaconda.com>
@@ -1,20 +0,0 @@
From c9be0588a59caea1087d65830d5f4a8ce232bc21 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <ccawley2011@gmail.com>
Date: Mon, 4 Oct 2021 16:50:20 +0100
Subject: [PATCH] Add a plugin for targeting Windows XP
---
plugins/windows-xp/gcc-overlay.mk | 4 ++++
1 file changed, 4 insertions(+)
create mode 100644 plugins/windows-xp/gcc-overlay.mk
diff --git a/plugins/windows-xp/gcc-overlay.mk b/plugins/windows-xp/gcc-overlay.mk
new file mode 100644
index 0000000000..111bc2e20d
--- /dev/null
+++ b/plugins/windows-xp/gcc-overlay.mk
@@ -0,0 +1,4 @@
+# This file is part of MXE. See LICENSE.md for licensing information.
+
+mingw-w64-headers_CONFIGURE_OPTS = --with-default-win32-winnt=0x0501
+mingw-w64-crt_CONFIGURE_OPTS = --with-default-win32-winnt=0x0501
@@ -19,7 +19,7 @@ MXE_TARGETS := x86_64-w64-mingw32.static i686-w64-mingw32.static
# This variable controls which plugins are in use.
# See plugins/README.md for further information.
#override MXE_PLUGIN_DIRS += plugins/apps plugins/native
override MXE_PLUGIN_DIRS += plugins/windows-xp plugins/gcc11
override MXE_PLUGIN_DIRS += plugins/windows-xp
# This variable controls the download mirror for SourceForge,
# when it is used. Enabling the value below means auto.