Add ucrt64 target

mingw_build_ucrt64 is set to 0, for bootstrapping purposes, to not build
it by default. We may decided to keep it 0, since converting all
packages can take a while.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2022-02-22 15:39:23 +04:00
parent ac9fcd8ab6
commit a4f0ba0de5
12 changed files with 440 additions and 42 deletions

View File

@ -1,8 +1,9 @@
# RPM macros for the Fedora MinGW Cross Compiler collection
%mingw_build_targets mingw32 mingw64
%mingw_build_targets mingw32 mingw64 ucrt64
%mingw_build_win32 1
%mingw_build_win64 1
%mingw_build_ucrt64 0
%mingw_strip mingw-strip
%mingw_objdump mingw-objdump
@ -22,6 +23,9 @@
%if 0%{?mingw_build_win64} == 1 \
%{?mingw64_debug_package} \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
%{?ucrt64_debug_package} \
%endif \
%{nil}
%mingw_package_header \
@ -48,6 +52,12 @@ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_configure} "$@" \
popd \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_configure} "$@" \
popd \
%endif \
} \
run_mingw_configure
@ -60,6 +70,9 @@ run_mingw_make() \
%if 0%{?mingw_build_win64} == 1 \
%{__make} -C build_win64$MINGW_BUILDDIR_SUFFIX "$@" $MINGW64_MAKE_ARGS \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
%{__make} -C build_ucrt64$MINGW_BUILDDIR_SUFFIX "$@" $UCRT64_MAKE_ARGS \
%endif \
} \
run_mingw_make
@ -78,6 +91,12 @@ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_cmake "$@"} \
popd \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_cmake "$@"} \
popd \
%endif \
} \
run_mingw_cmake
@ -96,6 +115,12 @@ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_cmake_kde4 "$@"} \
popd \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_cmake_kde4 "$@"} \
popd \
%endif \
} \
run_mingw_cmake_kde4
@ -114,6 +139,12 @@ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_qmake_qt5} "$@" \
popd \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_qmake_qt5} "$@" \
popd \
%endif \
} \
run_mingw_qmake_qt5
@ -132,6 +163,12 @@ pushd build_win64$MINGW_BUILDDIR_SUFFIX \
%{?mingw64_meson "$@"} \
popd \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
mkdir -p build_ucrt64$MINGW_BUILDDIR_SUFFIX \
pushd build_ucrt64$MINGW_BUILDDIR_SUFFIX \
%{?ucrt64_meson "$@"} \
popd \
%endif \
} \
run_mingw_meson
@ -144,6 +181,9 @@ ninja -C build_win32$MINGW_BUILDDIR_SUFFIX "$@" $MINGW32_NINJA_ARGS \
%if 0%{?mingw_build_win64} == 1 \
ninja -C build_win64$MINGW_BUILDDIR_SUFFIX "$@" $MINGW64_NINJA_ARGS \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
ninja -C build_ucrt64$MINGW_BUILDDIR_SUFFIX "$@" $UCRT64_NINJA_ARGS \
%endif \
} \
run_mingw_ninja
@ -156,6 +196,9 @@ DESTDIR=%{buildroot} ninja -C build_win32$MINGW_BUILDDIR_SUFFIX install \
%if 0%{?mingw_build_win64} == 1 \
DESTDIR=%{buildroot} ninja -C build_win64$MINGW_BUILDDIR_SUFFIX install \
%endif \
%if 0%{?mingw_build_ucrt64} == 1 \
DESTDIR=%{buildroot} ninja -C build_ucrt64$MINGW_BUILDDIR_SUFFIX install \
%endif \
} \
run_mingw_ninja_install

195
macros.ucrt64 Normal file
View File

@ -0,0 +1,195 @@
# RPM macros for Fedora MinGW UCRT64.
%ucrt64_pkg_name %(echo %{name} | sed 's/^mingw-/ucrt64-/')
%ucrt64_target x86_64-w64-mingw32ucrt
# Paths.
%ucrt64_sysroot %{_prefix}/%{ucrt64_target}/sys-root
%ucrt64_prefix %{ucrt64_sysroot}/mingw
%ucrt64_exec_prefix %{ucrt64_prefix}
%ucrt64_bindir %{ucrt64_exec_prefix}/bin
%ucrt64_sbindir %{ucrt64_exec_prefix}/sbin
%ucrt64_libexecdir %{ucrt64_exec_prefix}/libexec
%ucrt64_libdir %{ucrt64_exec_prefix}/lib
%ucrt64_datadir %{ucrt64_prefix}/share
%ucrt64_docdir %{ucrt64_prefix}/share/doc
%ucrt64_infodir %{ucrt64_prefix}/share/info
%ucrt64_mandir %{ucrt64_prefix}/share/man
%ucrt64_sysconfdir %{ucrt64_prefix}/etc
%ucrt64_sharedstatedir %{ucrt64_prefix}/com
%ucrt64_localstatedir %{ucrt64_prefix}/var
%ucrt64_includedir %{ucrt64_prefix}/include
# Build macros.
%ucrt64_host %{ucrt64_target}
%ucrt64_cflags %{ucrt64_cppflags} -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4
%ucrt64_cppflags %{nil}
%ucrt64_ldflags -fstack-protector -lssp
%ucrt64_cc %{ucrt64_target}-gcc
%ucrt64_cxx %{ucrt64_target}-g++
%ucrt64_cpp %{ucrt64_target}-gcc -E
%ucrt64_addr2line %{ucrt64_target}-addr2line
%ucrt64_ar %{ucrt64_target}-ar
%ucrt64_as %{ucrt64_target}-as
%ucrt64_dlltool %{ucrt64_target}-dlltool
%ucrt64_dllwrap %{ucrt64_target}-dllwrap
%ucrt64_gcov %{ucrt64_target}-gcov
%ucrt64_gprof %{ucrt64_target}-gprof
%ucrt64_ld %{ucrt64_target}-ld
%ucrt64_nm %{ucrt64_target}-nm
%ucrt64_objcopy %{ucrt64_target}-objcopy
%ucrt64_objdump %{ucrt64_target}-objdump
%ucrt64_ranlib %{ucrt64_target}-ranlib
%ucrt64_readelf %{ucrt64_target}-readelf
%ucrt64_size %{ucrt64_target}-size
%ucrt64_strings %{ucrt64_target}-strings
%ucrt64_strip %{ucrt64_target}-strip
%ucrt64_windmc %{ucrt64_target}-windmc
%ucrt64_windres %{ucrt64_target}-windres
%ucrt64_env unset $(/usr/bin/env | egrep '^(\w+)=(.*)$' | egrep -vw 'PWD|USER|LANG' | /usr/bin/cut -d= -f1); \
if test -z "$PATH_ORIG" ; then \
PATH_ORIG="$PATH"; export PATH_ORIG; \
fi; \
PATH="%{ucrt64_bindir}:$PATH_ORIG"; export PATH; \
HOST_CC=gcc; export HOST_CC; \
unset PKG_CONFIG_PATH; \
_PREFIX="%{_bindir}/%{ucrt64_target}-"; \
for i in `ls -1 ${_PREFIX}* | grep -v 'gcc-'`; do \
x=`echo $i|sed "s,${_PREFIX},,"|tr "a-z+-." "A-ZX__"`; \
declare -x $x="$i" ; export $x; \
done; \
unset _PREFIX; \
CC="${UCRT64_CC:-%ucrt64_cc}"; export CC; \
CFLAGS="${UCRT64_CFLAGS-%ucrt64_cflags}"; export CFLAGS; \
CPPFLAGS="${UCRT64_CPPFLAGS-%ucrt64_cppflags}"; export CPPFLAGS; \
if [ -x "%{_bindir}/%{ucrt64_cxx}" ]; then \
CXX="${UCRT64_CXX:-%ucrt64_cxx}"; export CXX; \
CXXFLAGS="${UCRT64_CXXFLAGS-%ucrt64_cflags}"; export CXXFLAGS; \
else \
CXX=; export CXX; \
ac_cv_prog_CXX=no; export ac_cv_prog_CXX; \
CXXFLAGS=; export CXXFLAGS; \
fi; \
LDFLAGS="${UCRT64_LDFLAGS:-%ucrt64_ldflags}"; export LDFLAGS; \
for i in `ls %{ucrt64_bindir}/*|grep -- "-config\$"` ; do \
x=`basename $i|tr "a-z+-." "A-ZX_"`; \
declare -x $x="$i" ; export $x; \
done; \
unset x i
%ucrt64_pkg_config %{ucrt64_target}-pkg-config "$@"
%ucrt64_pkgconfig_personalitydir %{mingw32_datadir}/pkgconfig/personality.d
%ucrt64_configure %{ucrt64_env} ; \
__ucrt64_topdir=.; if ! test -x configure; then __ucrt64_topdir=..; fi; \\\
$__ucrt64_topdir/configure \\\
--host=%{ucrt64_host} \\\
--build=%_build \\\
--target=%{ucrt64_target} \\\
--prefix=%{ucrt64_prefix} \\\
--exec-prefix=%{ucrt64_exec_prefix} \\\
--bindir=%{ucrt64_bindir} \\\
--sbindir=%{ucrt64_sbindir} \\\
--sysconfdir=%{ucrt64_sysconfdir} \\\
--datadir=%{ucrt64_datadir} \\\
--includedir=%{ucrt64_includedir} \\\
--libdir=%{ucrt64_libdir} \\\
--libexecdir=%{ucrt64_libexecdir} \\\
--localstatedir=%{ucrt64_localstatedir} \\\
--sharedstatedir=%{ucrt64_sharedstatedir} \\\
--mandir=%{ucrt64_mandir} \\\
--infodir=%{ucrt64_infodir} \\\
${MINGW_CONFIGURE_ARGS} \\\
${UCRT64_CONFIGURE_ARGS} "$@"
%ucrt64_make %{ucrt64_env} ; \
make \\\
prefix=%{ucrt64_prefix} \\\
exec_prefix=%{ucrt64_exec_prefix} \\\
bindir=%{ucrt64_bindir} \\\
sbindir=%{ucrt64_sbindir} \\\
sysconfdir=%{ucrt64_sysconfdir} \\\
datadir=%{ucrt64_datadir} \\\
includedir=%{ucrt64_includedir} \\\
libdir=%{ucrt64_libdir} \\\
libexecdir=%{ucrt64_libexecdir} \\\
localstatedir=%{ucrt64_localstatedir} \\\
sharedstatedir=%{ucrt64_sharedstatedir} \\\
mandir=%{ucrt64_mandir} \\\
infodir=%{ucrt64_infodir} "$@"
%ucrt64_cmake_generic %{ucrt64_env} ; \
PKG_CONFIG_LIBDIR="%{ucrt64_libdir}/pkgconfig:%{ucrt64_datadir}/pkgconfig"; export PKG_CONFIG_LIBDIR; \
if test -f CMakeLists.txt; then __ucrt64_topdir=.; \\\
elif test -f ../CMakeLists.txt; then __ucrt64_topdir=..; \\\
else __ucrt64_topdir=""; fi; \\\
if test "${MINGW_CMAKE_NO_VERBOSE}" == "" ; then \
UCRT64_CMAKE_ARGS="${UCRT64_CMAKE_ARGS} -DCMAKE_VERBOSE_MAKEFILE=ON" \
fi \
PATH=%{_prefix}/%{ucrt64_target}/bin:$PATH %__cmake \\\
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw/toolchain-mingw32ucrt64.cmake \\\
-DBUILD_SHARED_LIBS:BOOL=ON \\\
-DSYSCONF_INSTALL_DIR:PATH=%{ucrt64_sysconfdir} \\\
-DSHARE_INSTALL_PREFIX:PATH=%{ucrt64_datadir} \\\
-DCMAKE_INSTALL_PREFIX:PATH=%{ucrt64_prefix} \\\
-DCMAKE_INSTALL_LIBDIR:PATH=%{ucrt64_libdir} \\\
${MINGW_CMAKE_ARGS} \\\
${UCRT64_CMAKE_ARGS} \\\
"$@" $__ucrt64_topdir
%ucrt64_cmake \
UCRT64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{ucrt64_includedir} ${UCRT64_CMAKE_ARGS}" \
%ucrt64_cmake_generic
%ucrt64_cmake_kde4 \
UCRT64_CMAKE_ARGS="-DINCLUDE_INSTALL_DIR:PATH=%{ucrt64_includedir}/kde4 ${UCRT64_CMAKE_ARGS}" \
%ucrt64_cmake_generic
%ucrt64_qmake_qt5 /usr/bin/ucrt64-qmake-qt5
%ucrt64_meson %{ucrt64_env} ; \
unset CC CFLAGS CPPFLAGS CXX CXXFLAGS LD LDFLAGS; \\\
CFLAGS="${UCRT64_CFLAGS-%ucrt64_cflags}"; export CFLAGS; \\\
CPPFLAGS="${UCRT64_CPPFLAGS-%ucrt64_cppflags}"; export CPPFLAGS; \\\
LDFLAGS="${UCRT64_LDFLAGS:-%ucrt64_ldflags}"; export LDFLAGS; \\\
if test -f meson.build; then __ucrt64_topdir=.; \\\
elif test -f ../meson.build; then __ucrt64_topdir=..; \\\
else __ucrt64_topdir=""; fi; \\\
%__meson \\\
--cross-file /usr/share/mingw/toolchain-mingw32ucrt64.meson \\\
--default-library shared \\\
--prefix %{ucrt64_prefix} \\\
--bindir %{ucrt64_bindir} \\\
--sbindir %{ucrt64_sbindir} \\\
--sysconfdir %{ucrt64_sysconfdir} \\\
--datadir %{ucrt64_datadir} \\\
--includedir %{ucrt64_includedir} \\\
--libdir %{ucrt64_libdir} \\\
--libexecdir %{ucrt64_libexecdir} \\\
--localstatedir %{ucrt64_localstatedir} \\\
--sharedstatedir %{ucrt64_sharedstatedir} \\\
--mandir %{ucrt64_mandir} \\\
--infodir %{ucrt64_infodir} \\\
${MINGW_MESON_ARGS} \\\
${UCRT64_MESON_ARGS} \\\
"$@" $__ucrt64_topdir
%ucrt64_description This is the cross-compiled version of this library / tool.\
You should only install this package if you want to cross-compile programs for \
Win64 (64 bit Windows).
%ucrt64_debug_package \
%package -n %{ucrt64_pkg_name}-debuginfo \
Summary: Debug information for package %{ucrt64_pkg_name} \
Group: Development/Debug \
BuildArch: noarch \
%description -n %{ucrt64_pkg_name}-debuginfo \
This package provides debug information for package %{ucrt64_pkg_name}. \
Debug information is useful when developing applications that use this \
package or when debugging this package. \
%files -n %{ucrt64_pkg_name}-debuginfo -f ucrt64-debugfiles.list \
%defattr(-,root,root,-) \
%{nil}

View File

@ -6,7 +6,7 @@
%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
Name: mingw-filesystem
Version: 132
Version: 133
Release: 1%{?dist}
Summary: MinGW cross compiler base filesystem and environment
@ -18,27 +18,35 @@ Source0: COPYING
Source1: macros.mingw
Source2: macros.mingw32
Source3: macros.mingw64
Source4: mingw32.sh
Source5: mingw64.sh
Source6: mingw-find-debuginfo.sh
Source7: mingw.req
Source8: mingw.prov
Source9: mingw-scripts.sh
Source10: mingw-rpmlint.config
Source11: toolchain-mingw32.cmake
Source12: toolchain-mingw64.cmake
Source13: mingw-find-lang.sh
Source14: mingw32.attr
Source15: mingw64.attr
Source4: macros.ucrt64
Source5: mingw32.sh
Source6: mingw64.sh
Source7: ucrt64.sh
Source8: mingw-find-debuginfo.sh
Source9: mingw.req
Source10: mingw.prov
Source11: mingw-scripts.sh
Source12: mingw-rpmlint.config
Source13: toolchain-mingw32.cmake
Source14: toolchain-mingw64.cmake
Source15: toolchain-ucrt64.cmake
Source16: mingw-find-lang.sh
Source17: mingw32.attr
Source18: mingw64.attr
Source19: ucrt64.attr
# generated with:
# (rpm -ql mingw32-crt | grep '\.a$' | while read f ; do i686-w64-mingw32-dlltool -I $f 2>/dev/null ; done) | sort | uniq | tr A-Z a-z > standard-dlls-mingw32
Source16: standard-dlls-mingw32
Source20: standard-dlls-mingw32
# (rpm -ql mingw64-crt | grep '\.a$' | while read f ; do x86_64-w64-mingw32-dlltool -I $f 2>/dev/null ; done) | sort | uniq | tr A-Z a-z > standard-dlls-mingw64
Source17: standard-dlls-mingw64
Source18: toolchain-mingw32.meson
Source19: toolchain-mingw64.meson
Source20: pkgconf-personality-mingw32
Source21: pkgconf-personality-mingw64
Source21: standard-dlls-mingw64
# (rpm -ql ucrt64-crt | grep '\.a$' | while read f ; do x86_64-w64-mingw32ucrt-dlltool -I $f 2>/dev/null ; done) | sort | uniq | tr A-Z a-z > standard-dlls-mingw32ucrt64
Source22: standard-dlls-ucrt64
Source23: toolchain-mingw32.meson
Source24: toolchain-mingw64.meson
Source25: toolchain-ucrt64.meson
Source26: pkgconf-personality-mingw32
Source27: pkgconf-personality-mingw64
Source28: pkgconf-personality-ucrt64
# Taken from the Fedora filesystem package
Source101: https://fedorahosted.org/filesystem/browser/lang-exceptions
@ -60,7 +68,7 @@ This environment is maintained by the Fedora MinGW SIG at:
%package base
Summary: Generic files which are needed for both mingw32-filesystem and mingw64-filesystem
Summary: Generic files which are needed for {mingw32,mingw64,ucrt64}-filesystem
Requires: redhat-rpm-config
# Obsolete the packages from the test repo
@ -102,7 +110,7 @@ Provides: mingw32-pkg-config = 0.28-17
# proprietary DLLs in our find-requires checking script - essentially
# it comes out the same either way.
#
Provides: %(sed "s/\(.*\)/mingw32(\1) /g" %{SOURCE16} | tr "\n" " ")
Provides: %(sed "s/\(.*\)/mingw32(\1) /g" %{SOURCE20} | tr "\n" " ")
Provides: mingw32(mscoree.dll)
%description -n mingw32-filesystem
@ -122,7 +130,7 @@ Conflicts: mingw64-pkg-config < 0.28-17
Obsoletes: mingw64-pkg-config < 0.28-17
Provides: mingw64-pkg-config = 0.28-17
Provides: %(sed "s/\(.*\)/mingw64(\1) /g" %{SOURCE17} | tr "\n" " ")
Provides: %(sed "s/\(.*\)/mingw64(\1) /g" %{SOURCE21} | tr "\n" " ")
Provides: mingw64(mscoree.dll)
%description -n mingw64-filesystem
@ -133,6 +141,24 @@ This environment is maintained by the Fedora MinGW SIG at:
http://fedoraproject.org/wiki/SIGs/MinGW
%package -n ucrt64-filesystem
Summary: MinGW cross compiler base filesystem and environment for the win64 UCRT target
Requires: %{name}-base = %{version}-%{release}
# Replace ucrt64-pkg-config
Conflicts: ucrt64-pkg-config < 0.28-17
Obsoletes: ucrt64-pkg-config < 0.28-17
Provides: ucrt64-pkg-config = 0.28-17
Provides: %(sed "s/\(.*\)/ucrt64(\1) /g" %{SOURCE22} | tr "\n" " ")
Provides: ucrt64(mscoree.dll)
%description -n ucrt64-filesystem
This package contains the base filesystem layout, RPM macros and
environment for all Fedora MinGW packages.
This environment is maintained by the Fedora MinGW SIG at:
http://fedoraproject.org/wiki/SIGs/MinGW
%prep
%setup -q -c -T
@ -147,31 +173,35 @@ cp %{SOURCE0} COPYING
mkdir -p %{buildroot}
mkdir -p %{buildroot}%{_libexecdir}
install -m 755 %{SOURCE9} %{buildroot}%{_libexecdir}/mingw-scripts
install -m 755 %{SOURCE11} %{buildroot}%{_libexecdir}/mingw-scripts
mkdir -p %{buildroot}%{_bindir}
pushd %{buildroot}%{_bindir}
for i in mingw32-configure mingw32-cmake mingw32-make mingw32-meson mingw32-pkg-config \
mingw64-configure mingw64-cmake mingw64-make mingw64-meson mingw64-pkg-config ; do
mingw64-configure mingw64-cmake mingw64-make mingw64-meson mingw64-pkg-config \
ucrt64-configure ucrt64-cmake ucrt64-make ucrt64-meson ucrt64-pkg-config ; do
ln -s %{_libexecdir}/mingw-scripts $i
done
for i in i686-w64-mingw32-pkg-config \
x86_64-w64-mingw32-pkg-config ; do
x86_64-w64-mingw32-pkg-config \
x86_64-w64-mingw32ucrt-pkg-config ; do
ln -s %{_bindir}/pkgconf $i
done
popd
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/
install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/profile.d/
install -m 644 %{SOURCE6} %{buildroot}%{_sysconfdir}/profile.d/
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/profile.d/
mkdir -p %{buildroot}%{macrosdir}
install -m 644 %{SOURCE1} %{buildroot}%{macrosdir}/macros.mingw
install -m 644 %{SOURCE2} %{buildroot}%{macrosdir}/macros.mingw32
install -m 644 %{SOURCE3} %{buildroot}%{macrosdir}/macros.mingw64
install -m 644 %{SOURCE4} %{buildroot}%{macrosdir}/macros.ucrt64
mkdir -p %{buildroot}%{_sysconfdir}/rpmlint
install -m 644 %{SOURCE10} %{buildroot}%{_sysconfdir}/rpmlint/
install -m 644 %{SOURCE12} %{buildroot}%{_sysconfdir}/rpmlint/
# Create the folders required for gcc and binutils
mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32
@ -180,6 +210,9 @@ mkdir -p %{buildroot}%{_prefix}/i686-w64-mingw32/lib
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/bin
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/lib
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/bin
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/lib
# The MinGW system root which will contain Windows native binaries
# and Windows-specific header files, pkgconfig, etc.
@ -203,6 +236,16 @@ mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/lib/cmake
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/sbin
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/bin
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/etc
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/include
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/include
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/lib
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/lib/pkgconfig
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/lib/cmake
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/sbin
# We don't normally package manual pages and info files, except
# where those are not supplied by a Fedora native package. So we
# need to create the directories.
@ -235,8 +278,21 @@ mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/locale
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/pkgconfig
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/xml
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/doc
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/info
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/man
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/man/man{1,2,3,4,5,6,7,8,l,n}
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/aclocal
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/themes
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/cmake
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/locale
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/pkgconfig
mkdir -p %{buildroot}%{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/xml
mkdir -p %{buildroot}%{_prefix}/lib/debug/%{_prefix}/i686-w64-mingw32
mkdir -p %{buildroot}%{_prefix}/lib/debug/%{_prefix}/x86_64-w64-mingw32
mkdir -p %{buildroot}%{_prefix}/lib/debug/%{_prefix}/x86_64-w64-mingw32ucrt
# Own folders for all locales
# Snippet taken from the Fedora filesystem package
@ -253,6 +309,7 @@ grep -v "^$" %{buildroot}/iso_639.tab | grep -v "^#" | while read a b c d ; do
fi
echo "%lang(${locale}) %{_prefix}/i686-w64-mingw32/sys-root/mingw/share/locale/${locale}" >> filelist_mingw32
echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/locale/${locale}" >> filelist_mingw64
echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/locale/${locale}" >> filelist_ucrt
done
cat %{SOURCE101} | grep -v "^#" | grep -v "^$" | while read loc ; do
@ -274,40 +331,46 @@ cat %{SOURCE101} | grep -v "^#" | grep -v "^$" | while read loc ; do
fi
echo "%lang(${locale}) %{_prefix}/i686-w64-mingw32/sys-root/mingw/share/locale/${loc}" >> filelist_mingw32
echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32/sys-root/mingw/share/locale/${loc}" >> filelist_mingw64
echo "%lang(${locale}) %{_prefix}/x86_64-w64-mingw32ucrt/sys-root/mingw/share/locale/${loc}" >> filelist_ucrt
done
rm -f %{buildroot}/iso_639.tab
rm -f %{buildroot}/iso_3166.tab
cat filelist_mingw32 filelist_mingw64 | grep "locale" | while read a b ; do
cat filelist_mingw32 filelist_mingw64 filelist_ucrt | grep "locale" | while read a b ; do
mkdir -p -m 755 %{buildroot}/$b/LC_MESSAGES
done
# NB. NOT _libdir
mkdir -p %{buildroot}/usr/lib/rpm
install -m 0755 %{SOURCE6} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE7} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE8} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE13} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE9} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE10} %{buildroot}%{_rpmconfigdir}
install -m 0755 %{SOURCE16} %{buildroot}%{_rpmconfigdir}
mkdir -p %{buildroot}/usr/lib/rpm/fileattrs
install -m 0644 %{SOURCE14} %{buildroot}%{_rpmconfigdir}/fileattrs/
install -m 0644 %{SOURCE15} %{buildroot}%{_rpmconfigdir}/fileattrs/
install -m 0644 %{SOURCE17} %{buildroot}%{_rpmconfigdir}/fileattrs/
install -m 0644 %{SOURCE18} %{buildroot}%{_rpmconfigdir}/fileattrs/
install -m 0644 %{SOURCE19} %{buildroot}%{_rpmconfigdir}/fileattrs/
mkdir -p %{buildroot}%{_datadir}/mingw
install -m 0644 %{SOURCE11} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE12} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE18} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE19} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE13} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE14} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE15} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE23} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE24} %{buildroot}%{_datadir}/mingw/
install -m 0644 %{SOURCE25} %{buildroot}%{_datadir}/mingw/
mkdir -p %{buildroot}%{pkgconfig_personalitydir}
install -m 0644 %{SOURCE20} %{buildroot}%{pkgconfig_personalitydir}/i686-w64-mingw32.personality
install -m 0644 %{SOURCE21} %{buildroot}%{pkgconfig_personalitydir}/x86_64-w64-mingw32.personality
install -m 0644 %{SOURCE26} %{buildroot}%{pkgconfig_personalitydir}/i686-w64-mingw32.personality
install -m 0644 %{SOURCE27} %{buildroot}%{pkgconfig_personalitydir}/x86_64-w64-mingw32.personality
install -m 0644 %{SOURCE28} %{buildroot}%{pkgconfig_personalitydir}/x86_64-w64-mingw32ucrt.personality
# Link mingw-pkg-config man pages to pkgconf(1)
mkdir -p %{buildroot}%{_mandir}/man1/
echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/i686-w64-mingw32-pkg-config.1
echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-config.1
echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32ucrt-pkg-config.1
%files base
@ -357,7 +420,28 @@ echo ".so man1/pkgconf.1" > %{buildroot}%{_mandir}/man1/x86_64-w64-mingw32-pkg-c
%dir %{_prefix}/lib/debug/%{_prefix}/x86_64-w64-mingw32
%files -n ucrt64-filesystem
%{macrosdir}/macros.ucrt64
%config(noreplace) %{_sysconfdir}/profile.d/ucrt64.sh
%{_bindir}/ucrt64-configure
%{_bindir}/ucrt64-cmake
%{_bindir}/ucrt64-make
%{_bindir}/ucrt64-meson
%{_bindir}/ucrt64-pkg-config
%{_bindir}/x86_64-w64-mingw32ucrt-pkg-config
%{_prefix}/x86_64-w64-mingw32ucrt
%{_rpmconfigdir}/fileattrs/ucrt64.attr
%{_datadir}/mingw/toolchain-ucrt64.cmake
%{_datadir}/mingw/toolchain-ucrt64.meson
%{pkgconfig_personalitydir}/x86_64-w64-mingw32ucrt.personality
%{_mandir}/man1/x86_64-w64-mingw32ucrt-pkg-config.1*
%dir %{_prefix}/lib/debug/%{_prefix}
%dir %{_prefix}/lib/debug/%{_prefix}/x86_64-w64-mingw32ucrt
%changelog
* Tue Feb 22 2022 Marc-André Lureau <marcandre.lureau@redhat.com> - 133-1
- Add ucrt64 target. Related to rhbz#2055254.
* Mon Feb 21 2022 Sandro Mani <manisandro@gmail.com> - 132-1
- Create build_winXX directories with mkdir -p

View File

@ -26,6 +26,8 @@ if [ "`basename $0`" = "i686-w64-mingw32-pkg-config" ] ; then
NAME="mingw32_pkg_config"
elif [ "`basename $0`" = "x86_64-w64-mingw32-pkg-config" ] ; then
NAME="mingw64_pkg_config"
elif [ "`basename $0`" = "x86_64-w64-mingw32ucrt-pkg-config" ] ; then
NAME="ucrt64_pkg_config"
else
NAME="`basename $0|tr -- - _`"
fi
@ -37,6 +39,8 @@ if [[ $NAME == *cmake* ]] ; then
MINGW32_CXXFLAGS=${MINGW32_CXXFLAGS:-""}
MINGW64_CFLAGS=${MINGW64_CFLAGS:-""}
MINGW64_CXXFLAGS=${MINGW64_CXXFLAGS:-""}
UCRT64_CFLAGS=${UCRT64_CFLAGS:-""}
UCRT64_CXXFLAGS=${UCRT64_CXXFLAGS:-""}
fi
# NOTE: The use of 'eval' in combination with '$@' in the evaluated rpm macro is

View File

@ -5,7 +5,7 @@
targets=$@
if [ -z "$targets" ] ; then
echo "Usage: $0 [ mingw32 ] [ mingw64 ]"
echo "Usage: $0 [ mingw32 ] [ mingw64 ] [ ucrt64 ]"
exit 1
fi

View File

@ -7,7 +7,7 @@
targets=$@
if [ -z "$targets" ] ; then
echo "Usage: $0 [ mingw32 ] [ mingw64 ]"
echo "Usage: $0 [ mingw32 ] [ mingw64 ] [ ucrt64 ]"
exit 1
fi

View File

@ -0,0 +1,6 @@
# MinGW UCRT 64-bit x86 Windows target
Triplet: x86_64-w64-mingw32ucrt
SysrootDir: /usr/x86_64-w64-mingw32ucrt/sys-root/mingw
DefaultSearchPaths: /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/lib/pkgconfig:/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/share/pkgconfig
SystemIncludePaths: /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/include
SystemLibraryPaths: /usr/x86_64-w64-mingw32ucrt/sys-root/mingw/lib

1
standard-dlls-ucrt64 Symbolic link
View File

@ -0,0 +1 @@
standard-dlls-mingw64

37
toolchain-ucrt64.cmake Normal file
View File

@ -0,0 +1,37 @@
SET(CMAKE_SYSTEM_NAME Windows)
SET(CMAKE_SYSTEM_PROCESSOR x86_64)
# specify the cross compiler
IF(NOT DEFINED ENV{CC})
SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32ucrt-gcc)
ENDIF()
IF(NOT DEFINED ENV{CXX})
SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32ucrt-g++)
ENDIF()
IF(NOT DEFINED ENV{FC})
SET(CMAKE_Fortran_COMPILER /usr/bin/x86_64-w64-mingw32ucrt-gfortran)
ENDIF()
# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32ucrt/sys-root/mingw)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Make sure Qt can be detected by CMake
SET(QT_BINARY_DIR /usr/x86_64-w64-mingw32ucrt/bin /usr/bin)
# set the resource compiler (RHBZ #652435)
IF(NOT $ENV{RC})
SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32ucrt-windres)
ENDIF()
# These are needed for compiling lapack (RHBZ #753906)
SET(CMAKE_AR:FILEPATH /usr/bin/x86_64-w64-mingw32ucrt-ar)
SET(CMAKE_RANLIB:FILEPATH /usr/bin/x86_64-w64-mingw32ucrt-ranlib)
# Workaround failure to detect boost (see #2037724)
SET(Boost_ARCHITECTURE "-x64")

22
toolchain-ucrt64.meson Normal file
View File

@ -0,0 +1,22 @@
[binaries]
c = 'x86_64-w64-mingw32ucrt-gcc'
cpp = 'x86_64-w64-mingw32ucrt-g++'
fortran = 'x86_64-w64-mingw32ucrt-gfortran'
rust = ['rustc', '--target', 'x86_64-pc-windows-msvc', '-C', 'linker=/usr/bin/x86_64-w64-mingw32ucrt-gcc']
ar = '/usr/bin/x86_64-w64-mingw32ucrt-ar'
pkgconfig = '/usr/bin/x86_64-w64-mingw32ucrt-pkg-config'
ranlib = '/usr/bin/x86_64-w64-mingw32ucrt-ranlib'
strip = '/usr/bin/x86_64-w64-mingw32ucrt-strip'
windres = '/usr/bin/x86_64-w64-mingw32ucrt-windres'
dlltool = '/usr/bin/x86_64-w64-mingw32ucrt-dlltool'
libgcrypt-config = '/usr/x86_64-w64-mingw32ucrt/sys-root/mingw/bin/libgcrypt-config'
[properties]
root = '/usr/x86_64-w64-mingw32ucrt/sys-root/mingw'
needs_exe_wrapper = true
[host_machine]
system = 'windows'
cpu_family = 'x86_64'
cpu = 'x86_64'
endian = 'little'

3
ucrt64.attr Normal file
View File

@ -0,0 +1,3 @@
%__ucrt64_provides %{_rpmconfigdir}/mingw.prov ucrt64
%__ucrt64_requires %{_rpmconfigdir}/mingw.req ucrt64
%__ucrt64_path ^%{ucrt64_prefix}/.*\.([Dd][Ll][Ll]|[Ee][Xx][Ee]|[Pp][Yy][Dd]?|[Pp][Cc])$

3
ucrt64.sh Normal file
View File

@ -0,0 +1,3 @@
# Environment variables for cross compilers.
alias ucrt64-env='eval `rpm --eval %{ucrt64_env}`'