-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2024-10-10 14:21 UTC+0200 Aleksander Czajczynski (hb fki.pl)
+ config/win/clang-noauto.mk + additional clang flavour checking when the compiler is specified via set HB_COMPILER=clang (not auto-detected) This is important for distributions of clang that bundle both gcc and clang in the same directory. Harbour 3.2 by default prioritize gcc over clang. For example you should be now able to build from winlibs.com by Brecht Sanders with environment setup such as: PATH=C:\winlibs\mingw64\bin;%PATH% HB_COMPILER=clang win-make * config/global.mk ! added workaround for common GNU Make issue with $(dir path with spaces/file) macro, commonly striking on Windows systems under "Program Files", but also possible in other setups. Workaround is to call $(call dir_with_spaces,$(HB_COMP_PATH)). I have only used this workaround in clang detection, but keep this in mind while revisiting detection of another compiler. * config/win/clang.mk * utils/hbmk2/hbmk2.prg * another rework of Clang on Windows detection (ARM64, x86_64, x86), solved problems with different availability of resource compiler, They are now probed in order: windres, llvm-windres, llvm-rc. * added option to use MinGW INPUT(file.o) link scripts for old tools To apply workaround with clang, set HB_USER_DFLAGS=--mingw-script It is not supported in at least some of current clang toolchains, but it's still needed to succesfully build on old ones (those using GNU ld on Windows).
- Loading branch information
Showing
5 changed files
with
246 additions
and
34 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
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,90 @@ | ||
# Brecht Sanders winlibs clang distribution and possiblty others are impossible | ||
# to detect from path alone as clang.exe resides in the same directory with gcc, | ||
# in Harbour 3.2 gcc has priority over clang for backwards compatibility | ||
|
||
# supp. actions if the set HB_COMPILER=clang was specified, not auto-detected | ||
ifneq ($(HB_COMPILER_ORI),) | ||
HB_COMP_PATH := $(call find_in_path_raw,clang.exe) | ||
HB_COMP_PWD := $(call dir_with_spaces,$(HB_COMP_PATH)) | ||
ifneq ($(HB_COMP_PATH),) | ||
ifneq ($(wildcard $(HB_COMP_PWD)../x86_64-w64-mingw32/lib/lib*.a),) | ||
MSYSTEM := CLANG64 | ||
HB_CPU := x86_64 | ||
else | ||
ifneq ($(wildcard $(HB_COMP_PWD)../i686-w64-mingw32/lib/lib*.a),) | ||
MSYSTEM := CLANG32 | ||
HB_CPU := x86 | ||
else | ||
ifneq ($(wildcard $(HB_COMP_PWD)../aarch64-w64-mingw32/lib/lib*.a),) | ||
MSYSTEM := CLANGARM64 | ||
HB_CPU := arm64 | ||
else | ||
ifneq ($(findstring /VC/Tools/Llvm/ARM64/,$(HB_COMP_PATH)),) | ||
MSYSTEM := | ||
HB_CPU := arm64 | ||
else | ||
ifneq ($(findstring /VC/Tools/Llvm/x64/,$(HB_COMP_PATH)),) | ||
MSYSTEM := | ||
HB_CPU := x86_64 | ||
else | ||
ifneq ($(findstring mingw64,$(HB_COMP_PWD)),) | ||
MSYSTEM := CLANG64 | ||
else | ||
ifneq ($(findstring mingw32,$(HB_COMP_PWD)),) | ||
MSYSTEM := CLANG32 | ||
HB_CPU := x86 | ||
else | ||
MSYSTEM := $(shell clang --version) | ||
ifneq ($(findstring x86_64-pc-windows-msvc,$(MSYSTEM)),) | ||
MSYSTEM := | ||
HB_CPU := x86_64 | ||
else | ||
ifneq ($(findstring i686-pc-windows-msvc,$(MSYSTEM)),) | ||
MSYSTEM := | ||
HB_CPU := x86 | ||
else | ||
ifneq ($(findstring aarch64-pc-windows-msvc,$(MSYSTEM)),) | ||
MSYSTEM := | ||
HB_CPU := arm64 | ||
ifneq ($(findstring x86_64-w64-windows-gnu,$(MSYSTEM)),) | ||
HB_CPU := x86_64 | ||
MSYSTEM := CLANG64 | ||
else | ||
ifneq ($(findstring i686-w64-windows-gnu,$(MSYSTEM)),) | ||
HB_CPU := x86 | ||
MSYSTEM := CLANG32 | ||
else | ||
ifneq ($(findstring aarch64-w64-windows-gnu,$(MSYSTEM)),) | ||
HB_CPU := arm64 | ||
MSYSTEM := CLANGARM64 | ||
else | ||
ifneq ($(findstring -windows-gnu,$(MSYSTEM)),) | ||
MSYSTEM := CLANG | ||
else | ||
MSYSTEM := | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif | ||
export MSYSTEM | ||
ifneq ($(HB_CPU),$(HB_HOST_CPU)) | ||
ifeq ($(HB_BUILD_NAME),) | ||
ifeq ($(HB_CPU),x86_64) | ||
export HB_BUILD_NAME := 64 | ||
else | ||
export HB_BUILD_NAME := HB_CPU | ||
endif | ||
endif | ||
endif | ||
endif | ||
endif |
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