diff --git a/etc/config.csh/settings b/etc/config.csh/settings index ca3490032fb77533ea6af4f05e7d462f98253757..09be3c5a47a81175705ee2dfcc0d38562c2bac75 100644 --- a/etc/config.csh/settings +++ b/etc/config.csh/settings @@ -90,12 +90,22 @@ case Linux: endsw breaksw -case Darwin: # Presume x86_64, with clang (not gcc) as system compiler +# Presume x86_64, with clang (not gcc) as system compiler +case Darwin: setenv WM_ARCH darwin64 if ("$WM_COMPILER" == Gcc) setenv WM_COMPILER Clang echo "Darwin support is clang/llvm only" breaksw +# Presume x86_64, with mingw cross-compiled +case MINGW*: +case MSYS*: + WM_ARCH=win64 + if ("$WM_COMPILER" == Gcc) setenv WM_COMPILER Mingw + setenv WM_COMPILER_LIB_ARCH 64 # Consistent with linux64Mingw + echo "Windows support (mingw64) is runtime only" + ;; + case SunOS*: setenv WM_ARCH solaris64 setenv WM_COMPILER_LIB_ARCH 64 diff --git a/etc/config.sh/settings b/etc/config.sh/settings index 69ad56b3857d8ec80d68876d1e3da7beb80224a2..327b21f8fc0e3d5e0bf58b0bb8a8d295f9b66d76 100644 --- a/etc/config.sh/settings +++ b/etc/config.sh/settings @@ -82,18 +82,27 @@ Linux) esac ;; -Darwin) # Presume x86_64, with clang (not gcc) as system compiler +# Presume x86_64, with clang (not gcc) as system compiler +Darwin) WM_ARCH=darwin64 [ "$WM_COMPILER" = Gcc ] && WM_COMPILER=Clang echo "Darwin support is clang/llvm only" 1>&2 ;; +# Presume x86_64, with mingw cross-compiled +MINGW* | MSYS*) + WM_ARCH=win64 + [ "$WM_COMPILER" = Gcc ] && WM_COMPILER=Mingw + export WM_COMPILER_LIB_ARCH=64 # Consistent with linux64Mingw + echo "Windows support (mingw64) is runtime only" 1>&2 + ;; + SunOS*) WM_ARCH=solaris64 export WM_COMPILER_LIB_ARCH=64 ;; -*) # An unsupported operating system +*) /bin/cat << UNSUPPORTED 1>&2 =============================================================================== Operating system '$WM_ARCH' is unsupported by this OpenFOAM release. diff --git a/wmake/src/Allmake b/wmake/src/Allmake index 9e78c5eb5284847bdb6acf6f07914ec6c403f673..406daf115a66f3fdb04a2357d3c5b7562a80e00b 100755 --- a/wmake/src/Allmake +++ b/wmake/src/Allmake @@ -21,19 +21,26 @@ then exit 1 fi -case "$WM_COMPILER" in -Mingw*) - # Host wmake toolchain with system gcc (when cross-compiling) + +if [ "${WM_COMPILER%Mingw}" != "$WM_COMPILER" ] && [ "$WM_ARCH" != win64 ] +then + # Mingw cross-compilation + + # Toolchain for build (system gcc) make \ WM_COMPILER=Gcc WM_COMPILER_TYPE=system \ WMAKE_BIN="${WM_PROJECT_DIR}/platforms/tools/${WM_ARCH}${WM_COMPILER}" \ "$@" - ;; -*) + # Toolchain for target (mingw) + make \ + WMAKE_BIN="${WM_PROJECT_DIR}/platforms/tools/win64${WM_COMPILER}" \ + "$@" +else + # Regular wmake toolchain make "$@" - ;; -esac + +fi #------------------------------------------------------------------------------ diff --git a/wmake/src/Makefile b/wmake/src/Makefile index 2b602f11c13857d51beee7087b078b23fb2b52b6..f53f29f50f7e23d02438f3eaf721b31d952b0f82 100644 --- a/wmake/src/Makefile +++ b/wmake/src/Makefile @@ -6,29 +6,20 @@ # \\/ M anipulation | #------------------------------------------------------------------------------ # Copyright (C) 2011-2016 OpenFOAM Foundation -# Copyright (C) 2017-2019 OpenCFD Ltd. +# Copyright (C) 2017-2020 OpenCFD Ltd. #------------------------------------------------------------------------------ # License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM. If not, see . +# This file is part of OpenFOAM, distributed under GPL-3.0-or-later. # # File # Makefile # # Description -# Makefile used to compile wmake utilities. +# Makefile for compiling wmake toolchain. +# +# Note +# The 'createCode' script is used to pre-generate the scanner code +# since ragel is not very prevalent. # #------------------------------------------------------------------------------ @@ -55,7 +46,7 @@ WM_COMPILE_OPTION = Opt GENERAL_RULES = $(WM_DIR)/rules/General include $(GENERAL_RULES)/general -archHost := $(WM_ARCH)$(WM_COMPILER) +archBuild := $(WM_ARCH)$(WM_COMPILER) archTarget := $(shell basename $(WMAKE_BIN)) @@ -71,8 +62,8 @@ all: $(WMAKE_BIN)/lemon$(EXT_EXE) $(WMAKE_BIN)/wmkdepend$(EXT_EXE) message old: $(WMAKE_BIN)/wmkdep$(EXT_EXE) message: -ifneq ($(archHost),$(archTarget)) - @echo "built wmake-bin ($(archTarget)) for $(archHost) host" +ifneq ($(archBuild),$(archTarget)) + @echo "built wmake-bin ($(archTarget)) with $(archBuild)" else @echo "built wmake-bin ($(archTarget))" endif