view src/mingw-w64.mk @ 5961:7c0066684448

Add support for building with UCRT on Windows. * configure.ac: Add new configure switch "--with-windows-msvcrt". It can be set to "msvcrt" (default) or "ucrt". * Makefile.in: Make configure result of new switch available in makefile rules. * src/mingw-w64.mk, src/build-gcc.mk: Select CRT when installing system headers and when compiling system runtime. See also: https://octave.discourse.group/t/1821
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 18 Nov 2021 14:49:26 +0100
parents ec73307e819c
children 15322fbad67c
line wrap: on
line source

# This file is part of MXE.
# See index.html for further information.

PKG             := mingw-w64
$(PKG)_IGNORE   :=
$(PKG)_VERSION  := 9.0.0
$(PKG)_CHECKSUM := 9c496ed063e085888d250cc461ec4d31d97b72f1
$(PKG)_SUBDIR   := $(PKG)-v$($(PKG)_VERSION)
$(PKG)_FILE     := $(PKG)-v$($(PKG)_VERSION).tar.bz2
$(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/$(PKG)/$(PKG)/$(PKG)-release/$($(PKG)_FILE)
$(PKG)_DEPS     :=

define $(PKG)_UPDATE
  $(WGET) -q -O- 'http://sourceforge.net/projects/mingw-w64/files/mingw-w64/mingw-w64-release/' | \
  $(SED) -n 's,.*mingw-w64-v\([0-9.]*\)\.tar.*,\1,p' | \
  $(SORT) -V | \
  tail -1
endef

ifeq ($(OCTAVE_TARGET),default-octave)
  # FIXME: Adapt condition when Octave 7 moves to stable or it is released.
  $(PKG)_WINAPI_VERSION_FLAGS := --with-default-win32-winnt=0x0601
endif

ifneq ($(HOST_MSVCRT),ucrt)
  $(PKG)_DEFAULT_MSVCRT := --with-default-msvcrt=msvcrt
else
  $(PKG)_DEFAULT_MSVCRT := --with-default-msvcrt=ucrt
endif

define $(PKG)_BUILD
  mkdir '$(1).headers-build'
  cd '$(1).headers-build' && '$(1)/mingw-w64-headers/configure' \
    --host='$(TARGET)' \
    --prefix='$(HOST_PREFIX)' \
    --enable-sdk=all \
    --enable-idl \
    --enable-secure-api \
    $($(PKG)_WINAPI_VERSION_FLAGS) \
    $($(PKG)_DEFAULT_MSVCRT)

  $(MAKE) -C '$(1).headers-build' install
endef